-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Multiline Filter Definitions Not Supported #5235
Comments
@edsiper I am not sure of the best way to fix this. I have two questions:
|
I can think about receiving docker logs through Forward, but you don't know if the format is Docker or CRI-o. besides that not sure what users could try to accomplish. Note that multiline core already supports multiple formats so we can avoid the user configuring multilple independent filters. Maybe we need the users to elaborate more on their use cases in this ticket |
@edsiper Cool, I will direct users to this issue to post about their needs and we can determine if we need to support multiple filters. For the time being, I will assume its not urgent and will submit a doc PR to clearly note this in the docs. |
Hello @PettitWesley Sometimes for simplicity it's very convenient to declare multiple multiline filters instead of playing with tagging the containers in the tail input. Although ,I agree that it could be logically incorrect solution. Anyway, I would like to ask . Does it provide the same functionality when I specify multiple parsers in the same filter like you mentioned in the workaround? I mean [FILTER] vs two separated multiline filters? |
Maybe related to #5524 (comment) |
@alexku7 Yea, specifying multiple parsers should have the same effect as you'd want from multiple filter definitions... if it doesnt then please let us know. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
Just to clarify, but multiple multiline parsers in [INPUT] section are allowed? like How to understand The two options separated by a comma means multi-format: try |
Ah, I misunderstood first! Add a pull request to correct documentation: fluent/fluent-bit-docs#1392 |
Would a use case be potentially handling both a partial_message case as well as a language specific multi-line parser case? #4309 mentions two filter instances being required to handle both cases, but this issue seems to indicate doing so would cause an infinite loop. |
Bug Report
If you put two multiline filter definitions in your conf and they both match the same logs this leads to a problem:
This leads to error messages like:
And can cause high memory usage and even cause Fluent Bit to crash.
Why does this happen?
This is because the multiline filter using an emitter input instance to re-emit completed records at the start of the Fluent Bit log pipeline.
In the multiline design #4309 I tried to prevent cycles by having the filter recognize its own in_emitter instance and not try to parse records from its own emitter. Unfortunately, this only solves the problem for a single filter instance. Two filters can lead to a cycle.
So let's go through an example to see why this happens:
Workaround 1: If you need only one parser applied to each log statement
The workaround is to only have a single filter definition but remember that you can use multiple parsers in a single definition. The Fluent Bit multiline filtr can only apply a single multiline parser to each log record; it will try each parser in the comma delimited list in order, and apply the first one that matches the log (i.e. use the first parser which has a start_state that matches the log).
This limitation means that each log record can only have 2 multiline parsers successfully applied to it. The first appliedparser can be defined with the tail multiline settings, and the second applied parser can be specified in a multiline filter definition.
So my example from above can become a single filter definition like so:
Workaround 2: If logs can be differentiated by log tag
Another option is if you can have the
Match
pattern for each filter match different tags.The text was updated successfully, but these errors were encountered: