I encountered a certain problem when trying to create the multiline features in filebeat. I dont have online access to the examples right now, so I'll just present an abstraction of the situation.
I have a certain log file which the filebeat tails. Assume it has only two patterns of lines, A and B (where A is simply not B).
The multiline configuration is the following:
pattern: ^B
negate: true
match: after
Everything else is default.
I matched the regex which both types of lines in the Go Playground, and got the desired result, hence assume the regex is valid.
The problem occurs when the file has no lines of type B at all. Instead of getting multiple events containing a single A each, I get batches of A. For example:
A\n
A\n
A\n ==> {AA} {AA}
A\n
I suspect the batch's size is just the number of lines processed by Filebeat every Timout (which default to 5s).
As far as I understand, disabling the timeout in the " Only 'A' " would just result in Filebeat aggregating the lines into the buffer, and probably throw them in a single batch again, but instead after 5 seconds, after some size limitation.
As a note, in a log file where B occurs every now and then, I get the expected result of B followed by some 'A's.
How can I overcome this? (I don't eliminate the possibility that perhaps I misunderstood the Timeout property.)
Thanks