-
Notifications
You must be signed in to change notification settings - Fork 1.8k
filter_grep: grep with arithmetic operators #5449
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
base: master
Are you sure you want to change the base?
Conversation
58b4b23 to
b8ef5ce
Compare
Signed-off-by: Marcos Diez <[email protected]>
b8ef5ce to
21a766d
Compare
|
I think it is better to create new filter plugin to support these operators. |
|
Hi
I thought about that. But then we would have two different commands that with the same final objective: drop arbitrary log entries.
Also, I am not sure what we should call it. Numerical Parser? Numerical Evaluator? Algebric log entry remover? Number Comparer?
I considered also not adding the arithimethical methods and just silently converting the numbers to a string so they would work with a regular expression, but I thought that would be more restrictive and way less efficient.
One last argument against creating a new filter is that we already have "Modify" and "Record Modifier" which are confusing enough and parially redundant.
I did not want to go that route.
I do agree the interface is not perfect and we could improve.
On the bright side, the code is already processing GBs of data daily and working well :)
Il 14 Maggio 2022 09:24:53 GMT-03:00, Takahiro Yamashita ***@***.***> ha scritto:
I think it is better to create new filter plugin to support these operators.
Because `grep` command doesn't support these operations.
--
Reply to this email directly or view it on GitHub:
#5449 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
|
I'm +1 to having this in grep filter for now. We most likely need a longer-term implementation on comparisons (str + numbers). Though I don't think it should block progress for solving the current challenge. cc @nokute78 |
|
The basis of grep is match or not match pattern. I agree to support to check if the number is matched or not. On the other hand, comparison operation is not supported by
I agree and it is complicated for user...
Naming is one of difficult things. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
@marcosdiez can you take a look at resolving the conflicts in this PR? |
Documentation: fluent/fluent-bit-docs#810
The
grepfilter does uses regexes only to match strings.So I added a few arithmetic operators to match numbers (booleans, ints, floats and doubles):
Simple example to test:
debug output: https://gist.github.com/marcosdiez/52f1aca31ac69dda43c3dbe2d56e4ad0
Valgrind output: https://gist.github.com/marcosdiez/7f37b3e53a5252c2c33569e01e5b79d2
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.