Hello everyone,
It seem to me that filebeat is sending entry to logstash for every line individually . What we want ( if it is possible ) is to club the lines or groups them and then sent them to logstash.
So ... ,
Is it possible to merge lines in Filebeat before sending them to logstash?
Example .
If my log file let say production.log has entry that look like this.
Sending ... 0 .. 2016-02-17 13:20:13 +0530
Sending ... 1 .. 2016-02-17 13:20:13 +0530
Sending ... 2 .. 2016-02-17 13:20:14 +0530
Sending ... 3 .. 2016-02-17 13:20:14 +0530
Sending ... 4 .. 2016-02-17 13:20:14 +0530
Sending ... 5 .. 2016-02-17 13:20:15 +0530
Sending ... 6 .. 2016-02-17 13:20:15 +0530
Sending ... 7 .. 2016-02-17 13:20:16 +0530
Sending ... 8 .. 2016-02-17 13:20:16 +0530
Sending ... 9 .. 2016-02-17 13:20:16 +0530
Sending ... 10 .. 2016-02-17 13:20:17 +0530
Sending ... 11 .. 2016-02-17 13:20:17 +0530
Sending ... 12 .. 2016-02-17 13:20:18 +0530
Sending ... 13 .. 2016-02-17 13:20:18 +0530
Sending ... 14 .. 2016-02-17 13:20:18 +0530
Sending ... 15 .. 2016-02-17 13:20:19 +0530
Sending ... 16 .. 2016-02-17 13:20:19 +0530
Sending ... 17 .. 2016-02-17 13:20:20 +0530
Sending ... 18 .. 2016-02-17 13:20:20 +0530
Sending ... 19 .. 2016-02-17 13:20:20 +0530
Sending ... 20 .. 2016-02-17 13:20:21 +0530
Sending ... 21 .. 2016-02-17 13:20:21 +0530
Sending ... 22 .. 2016-02-17 13:20:22 +0530
Sending ... 23 .. 2016-02-17 13:20:22 +0530
Sending ... 24 .. 2016-02-17 13:20:22 +0530
Sending ... 25 .. 2016-02-17 13:20:23 +0530
Sending ... 26 .. 2016-02-17 13:20:23 +0530
Sending ... 27 .. 2016-02-17 13:20:24 +0530
Sending ... 28 .. 2016-02-17 13:20:24 +0530
Sending ... 29 .. 2016-02-17 13:20:24 +0530
Sending ... 30 .. 2016-02-17 13:20:25 +0530
Sending ... 31 .. 2016-02-17 13:20:25 +0530
Sending ... 32 .. 2016-02-17 13:20:26 +0530
Sending ... 33 .. 2016-02-17 13:20:26 +0530
Sending ... 34 .. 2016-02-17 13:20:26 +0530
Sending ... 35 .. 2016-02-17 13:20:27 +0530
Sending ... 36 .. 2016-02-17 13:20:27 +0530
Sending ... 37 .. 2016-02-17 13:20:28 +0530
Sending ... 38 .. 2016-02-17 13:20:28 +0530
Sending ... 39 .. 2016-02-17 13:20:29 +0530
Sending ... 40 .. 2016-02-17 13:20:29 +0530
Sending ... 41 .. 2016-02-17 13:20:30 +0530
Now we want filebeat to group them (better word merge them) and then sent them across to logstash
example : (Unfortunately this does not work )
... ...
multiline:
max_lines: 16
So the eventual event that get sent to the logstash/elastic would look like this
1 event (with message as ..) [ formatted the message for readability purposes ]
Sending ... 0 .. 2016-02-17 13:20:13 +0530
Sending ... 1 .. 2016-02-17 13:20:13 +0530
Sending ... 2 .. 2016-02-17 13:20:14 +0530
Sending ... 3 .. 2016-02-17 13:20:14 +0530
Sending ... 4 .. 2016-02-17 13:20:14 +0530
Sending ... 5 .. 2016-02-17 13:20:15 +0530
Sending ... 6 .. 2016-02-17 13:20:15 +0530
Sending ... 7 .. 2016-02-17 13:20:16 +0530
Sending ... 8 .. 2016-02-17 13:20:16 +0530
Sending ... 9 .. 2016-02-17 13:20:16 +0530
Sending ... 10 .. 2016-02-17 13:20:17 +0530
Sending ... 11 .. 2016-02-17 13:20:17 +0530
Sending ... 12 .. 2016-02-17 13:20:18 +0530
Sending ... 13 .. 2016-02-17 13:20:18 +0530
Sending ... 14 .. 2016-02-17 13:20:18 +0530
Sending ... 15 .. 2016-02-17 13:20:19 +0530
event 2 (with message as ..)
Sending ... 16 .. 2016-02-17 13:20:19 +0530
Sending ... 17 .. 2016-02-17 13:20:20 +0530
Sending ... 18 .. 2016-02-17 13:20:20 +0530
Sending ... 19 .. 2016-02-17 13:20:20 +0530
Sending ... 20 .. 2016-02-17 13:20:21 +0530
Sending ... 21 .. 2016-02-17 13:20:21 +0530
Sending ... 22 .. 2016-02-17 13:20:22 +0530
Sending ... 23 .. 2016-02-17 13:20:22 +0530
Sending ... 24 .. 2016-02-17 13:20:22 +0530
Sending ... 25 .. 2016-02-17 13:20:23 +0530
Sending ... 26 .. 2016-02-17 13:20:23 +0530
Sending ... 27 .. 2016-02-17 13:20:24 +0530
Sending ... 28 .. 2016-02-17 13:20:24 +0530
Sending ... 29 .. 2016-02-17 13:20:24 +0530
Sending ... 30 .. 2016-02-17 13:20:25 +0530
Sending ... 31 .. 2016-02-17 13:20:25 +0530
Sending ... 32 .. 2016-02-17 13:20:26 +0530
And so on ...
But unfortunately above configuration(max_lines) doesn't work like I was expecting it too (see attached screenshot)
Here, how my Filebeat config look like
Btw, using Regex for a specific message only is not what I'm looking at from here.
Lastly, the Filebeat version is 1.1.0.
Thanks Everyone.