Skip to content

Instantly share code, notes, and snippets.

@mjasion
Last active January 29, 2017 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjasion/235768fb87a7f708264669af755bd23d to your computer and use it in GitHub Desktop.
Save mjasion/235768fb87a7f708264669af755bd23d to your computer and use it in GitHub Desktop.
Filebeat multiline bug
FROM ubuntu:16.04
ENV TZ Europe/Warsaw
ENV FILEBEAT_VERSION 5.1.2
RUN apt-get update && \
apt-get install wget curl iputils-ping net-tools less -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-${FILEBEAT_VERSION}-amd64.deb&& \
dpkg -i filebeat-${FILEBEAT_VERSION}-amd64.deb && \
rm filebeat-${FILEBEAT_VERSION}-amd64.deb
RUN mkdir -p /logs
WORKDIR /logs
ADD maxlines.csv /logs/
ADD filebeat.yml /etc/filebeat/filebeat.yml
CMD /usr/share/filebeat/bin/filebeat -e -c /etc/filebeat/filebeat.yml
2017/01/29 08:56:16.099918 beat.go:267: INFO Home path: [/usr/share/filebeat/bin] Config path: [/usr/share/filebeat/bin] Data path: [/usr/share/filebeat/bin/data] Logs path: [/usr/share/filebeat/bin/logs]
2017/01/29 08:56:16.099997 beat.go:177: INFO Setup Beat: filebeat; Version: 5.1.2
2017/01/29 08:56:16.100004 logp.go:219: INFO Metrics logging every 30s
2017/01/29 08:56:16.100007 processor.go:43: DBG Processors:
2017/01/29 08:56:16.100027 beat.go:183: DBG Initializing output plugins
2017/01/29 08:56:16.101054 logstash.go:90: INFO Max Retries set to: 3
2017/01/29 08:56:16.101097 outputs.go:106: INFO Activated logstash as output plugin.
2017/01/29 08:56:16.101106 publish.go:234: DBG Create output worker
2017/01/29 08:56:16.101155 publish.go:276: DBG No output is defined to store the topology. The server fields might not be filled.
2017/01/29 08:56:16.101197 publish.go:291: INFO Publisher name: msi
2017/01/29 08:56:16.102576 async.go:63: INFO Flush Interval set to: 1s
2017/01/29 08:56:16.102584 async.go:64: INFO Max Bulk Size set to: 2048
2017/01/29 08:56:16.102589 async.go:72: DBG create bulk processing worker (interval=1s, bulk size=2048)
2017/01/29 08:56:16.102672 beat.go:207: INFO filebeat start running.
2017/01/29 08:56:16.102696 registrar.go:68: INFO No registry file found under: /usr/share/filebeat/bin/data/registry. Creating a new registry file.
2017/01/29 08:56:16.102705 registrar.go:298: DBG Write registry file: /usr/share/filebeat/bin/data/registry
2017/01/29 08:56:16.102824 registrar.go:323: DBG Registry file updated. 0 states written.
2017/01/29 08:56:16.102848 registrar.go:106: INFO Loading registrar data from /usr/share/filebeat/bin/data/registry
2017/01/29 08:56:16.102863 registrar.go:123: INFO States Loaded from registrar: 0
2017/01/29 08:56:16.102880 crawler.go:34: INFO Loading Prospectors: 1
2017/01/29 08:56:16.102912 prospector_log.go:41: DBG exclude_files: []
2017/01/29 08:56:16.102918 prospector_log.go:57: INFO Prospector with previous states loaded: 0
2017/01/29 08:56:16.102974 registrar.go:236: INFO Starting Registrar
2017/01/29 08:56:16.102988 prospector.go:69: DBG File Configs: [/logs/maxlines.csv]
2017/01/29 08:56:16.102977 sync.go:41: INFO Start sending events to output
2017/01/29 08:56:16.102997 crawler.go:46: INFO Loading Prospectors completed. Number of prospectors: 1
2017/01/29 08:56:16.103016 crawler.go:61: INFO All prospectors are initialised and running with 0 states to persist
2017/01/29 08:56:16.103020 spooler.go:63: INFO Starting spooler: spool_size: 2048; idle_timeout: 5s
2017/01/29 08:56:16.103024 crawler.go:56: DBG Starting prospector 0
2017/01/29 08:56:16.103043 prospector.go:111: INFO Starting prospector of type: log
2017/01/29 08:56:16.103048 prospector_log.go:62: DBG Start next scan
2017/01/29 08:56:16.103076 prospector_log.go:212: DBG Check file for harvesting: /logs/maxlines.csv
2017/01/29 08:56:16.103082 prospector_log.go:231: DBG Start harvester for new file: /logs/maxlines.csv
2017/01/29 08:56:16.103324 log.go:256: DBG Setting offset for file based on seek: /logs/maxlines.csv
2017/01/29 08:56:16.103333 log.go:241: DBG Setting offset for file: /logs/maxlines.csv. Offset: 0
2017/01/29 08:56:16.103366 state.go:64: DBG New state added for /logs/maxlines.csv
2017/01/29 08:56:16.103378 prospector_log.go:83: DBG Prospector states cleaned up. Before: 1, After: 1
2017/01/29 08:56:16.103407 log.go:84: INFO Harvester started for file: /logs/maxlines.csv
2017/01/29 08:56:16.105183 log_file.go:84: DBG End of file reached: /logs/maxlines.csv; Backoff now.
2017/01/29 08:56:17.105436 log_file.go:84: DBG End of file reached: /logs/maxlines.csv; Backoff now.
2017/01/29 08:56:19.105677 log_file.go:84: DBG End of file reached: /logs/maxlines.csv; Backoff now.
2017/01/29 08:56:21.103190 spooler.go:89: DBG Flushing spooler because of timeout. Events flushed: 1
2017/01/29 08:56:21.103228 client.go:128: DBG No events to publish
2017/01/29 08:56:21.103237 sync.go:68: DBG Events sent: 1
2017/01/29 08:56:21.103248 registrar.go:275: DBG Processing 1 events
2017/01/29 08:56:21.103256 state.go:64: DBG New state added for /logs/maxlines.csv
2017/01/29 08:56:21.103263 registrar.go:261: DBG Registrar states cleaned up. Before: 1, After: 1
2017/01/29 08:56:21.103268 registrar.go:298: DBG Write registry file: /usr/share/filebeat/bin/data/registry
2017/01/29 08:56:21.103921 registrar.go:323: DBG Registry file updated. 1 states written.
2017/01/29 08:56:23.105849 log_file.go:84: DBG End of file reached: /logs/maxlines.csv; Backoff now.
2017/01/29 08:56:26.103380 spooler.go:89: DBG Flushing spooler because of timeout. Events flushed: 1
2017/01/29 08:56:26.103478 prospector.go:155: DBG Run prospector
2017/01/29 08:56:26.103495 prospector_log.go:62: DBG Start next scan
2017/01/29 08:56:26.103533 prospector_log.go:212: DBG Check file for harvesting: /logs/maxlines.csv
2017/01/29 08:56:26.103546 prospector_log.go:245: DBG Update existing file for harvesting: /logs/maxlines.csv, offset: 3891
2017/01/29 08:56:26.103555 prospector_log.go:297: DBG Harvester for file is still running: /logs/maxlines.csv
2017/01/29 08:56:26.103565 prospector_log.go:83: DBG Prospector states cleaned up. Before: 1, After: 1
2017/01/29 08:56:26.103651 client.go:184: DBG Publish: {
"@timestamp": "2017-01-29T08:56:16.103Z",
"beat": {
"hostname": "msi",
"name": "msi",
"version": "5.1.2"
},
"input_type": "log",
"message": "0001\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117\n118\n119\n120\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\n157\n158\n159\n160\n161\n162\n163\n164\n165\n166\n167\n168\n169\n170\n171\n172\n173\n174\n175\n176\n177\n178\n179\n180\n181\n182\n183\n184\n185\n186\n187\n188\n189\n190\n191\n192\n193\n194\n195\n196\n197\n198\n199\n200\n201\n202\n203\n204\n205\n206\n207\n208\n209\n210\n211\n212\n213\n214\n215\n216\n217\n218\n219\n220\n221\n222\n223\n224\n225\n226\n227\n228\n229\n230\n231\n232\n233\n234\n235\n236\n237\n238\n239\n240\n241\n242\n243\n244\n245\n246\n247\n248\n249\n250\n251\n252\n253\n254\n255\n256\n257\n258\n259\n260\n261\n262\n263\n264\n265\n266\n267\n268\n269\n270\n271\n272\n273\n274\n275\n276\n277\n278\n279\n280\n281\n282\n283\n284\n285\n286\n287\n288\n289\n290\n291\n292\n293\n294\n295\n296\n297\n298\n299\n300\n301\n302\n303\n304\n305\n306\n307\n308\n309\n310\n311\n312\n313\n314\n315\n316\n317\n318\n319\n320\n321\n322\n323\n324\n325\n326\n327\n328\n329\n330\n331\n332\n333\n334\n335\n336\n337\n338\n339\n340\n341\n342\n343\n344\n345\n346\n347\n348\n349\n350\n351\n352\n353\n354\n355\n356\n357\n358\n359\n360\n361\n362\n363\n364\n365\n366\n367\n368\n369\n370\n371\n372\n373\n374\n375\n376\n377\n378\n379\n380\n381\n382\n383\n384\n385\n386\n387\n388\n389\n390\n391\n392\n393\n394\n395\n396\n397\n398\n399\n400\n401\n402\n403\n404\n405\n406\n407\n408\n409\n410\n411\n412\n413\n414\n415\n416\n417\n418\n419\n420\n421\n422\n423\n424\n425\n426\n427\n428\n429\n430\n431\n432\n433\n434\n435\n436\n437\n438\n439\n440\n441\n442\n443\n444\n445\n446\n447\n448\n449\n450\n451\n452\n453\n454\n455\n456\n457\n458\n459\n460\n461\n462\n463\n464\n465\n466\n467\n468\n469\n470\n471\n472\n473\n474\n475\n476\n477\n478\n479\n480\n481\n482\n483\n484\n485\n486\n487\n488\n489\n490\n491\n492\n493\n494\n495\n496\n497\n498\n499\n500",
"offset": 3891,
"source": "/logs/maxlines.csv",
"type": "log"
}
2017/01/29 08:56:26.103689 output.go:109: DBG output worker: publish 1 events
2017/01/29 08:56:26.103697 sync.go:53: DBG connect
2017/01/29 08:56:26.103703 tls.go:200: WARN SSL/TLS verifications disabled.
2017/01/29 08:56:26.129555 sync.go:107: DBG Try to publish 1 events to logstash with window size 10
2017/01/29 08:56:26.136707 sync.go:78: DBG 1 events out of 1 events sent to logstash. Continue sending
2017/01/29 08:56:26.136726 single.go:150: DBG send completed
2017/01/29 08:56:26.136750 sync.go:68: DBG Events sent: 1
2017/01/29 08:56:26.136768 registrar.go:275: DBG Processing 1 events
2017/01/29 08:56:26.136777 registrar.go:261: DBG Registrar states cleaned up. Before: 1, After: 1
2017/01/29 08:56:26.136785 registrar.go:298: DBG Write registry file: /usr/share/filebeat/bin/data/registry
2017/01/29 08:56:26.138480 registrar.go:323: DBG Registry file updated. 1 states written.
filebeat.prospectors:
- input_type: log
paths:
- /logs/maxlines.csv
# match all numbers with at least 4 digits
multiline.pattern: '^[[:digit:]]{4,}'
multiline.negate: true
multiline.match: after
multiline.max_linex: 10000
output.logstash:
hosts: ["logstash:5000"]
ssl.certificate: "mycertificate"
ssl.key: "mykey"
ssl.verification_mode: none
#================================ Logging =====================================
# Sets log level. The default log level is info.
# Available log levels are: critical, error, warning, info, debug
logging.level: debug
# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
logging.selectors: ["*"]
input {
beats {
port => "5000"
ssl => true
ssl_certificate => "mycertificate"
ssl_key => "mykey"
}
}
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
0001
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment