-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Grep Filter Plugin Exclude Not Matching Issue #8098
Comments
Is it reproducible with the latest 2.1.10? |
I updated to the latest version of Fluent-bit:
And retested using the same configuration and input file with the same result. Number 1 and Number 3 both resulted in the correct behavior with all "DEBUG" lines excluded. All other variations resulted in all lines being retained. Updated output log (with added separators: testOutput.log ) |
I have reproduced the behavior described and tested an additional case in which there is only one space between the Key and the regular expression
it works, too. The extra spaces are interpreted as part of the regular expression. You can check it with Rubular. |
Good catch and I should have tested that case as well. I'll note the documentation does not appear to show more than one space between the key and regex in any of the examples so this could just be me interpreting it as being allowed when it's not intended to be. |
Yes, you're right. [PARSER]
Name my-parser1
Format regex
Regex ^(?<num>\d{1,3} |)\<(?<pri>[0-9]{1,5})\>1 (?<time1>[^ ]+) (?<host>[^ ]+) (?<ident>[^ ]+) (?<pid>[-0-9]+) (?<msgid>[^ ]+) (?<extradata>(\[(.*)\]|-)) (?<message>.+)$ Adding a note in the documentation may be necessary to highlight this particular difference. |
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 |
This issue was closed because it has been stalled for 5 days with no activity. |
This exact issue took me a couple of hours to figure out why my regex does not match. I think this should be fixed or at the very least document this with a warning in the docs. |
Bug Report
Describe the bug
In it's simplest form, using more than one space to separate the "Exclude" key and the regex value appears to be causing it not to match.
Specifically, using the filter:
With either of the following exclude lines:
Does not match a log line that it should. However, just removing the additional spaces between the Exclude Key, Key, and Regex:
Works as expected.
The documentation page does show more than one space used in multiple locations which would seem to indicate there is a documentation issue or a bug.
To Reproduce
The combined version of the configuration file that was used to verify the issue (after removing all extra spaces between Keys and values):
With a parser configuration file defined as:
Expected behavior
Based on the documentation, regardless of the number of spaces between the "Exclude" Key, Key, and Regex, We should see any line containing "DEBUG" with at least one space on either side excluded.
Screenshots
N/A
Your Environment
Additional context
Making a very long story short, this issue was discovered as part of getting multiline parsing working with the New Relic Infrastructure Agent. This is my first time working with Fluentbit in any form so I was assuming it was my fault until I discovered removing the additional spaces fixed the issue. Again, I'm not sure if this is just a documentation issue due to the need to maintain space sensitivity for the regex or if this is a bug and additional spaces should be trimmed. I'm hoping this is fixed and/or this report helps others with the same issue.
The text was updated successfully, but these errors were encountered: