-
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
filter_modify: Add data type condition checker to Modify
filter.
#2539
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: zihengCat <[email protected]>
thanks for this PR.
|
@edsiper
|
Signed-off-by: zihengCat <[email protected]>
src/flb_hash.c
Outdated
@@ -41,7 +41,7 @@ | |||
* 2. It will not produce the same results on little-endian and big-endian | |||
* machines. | |||
*/ | |||
static unsigned int gen_hash(const void *key, int len) | |||
unsigned int gen_hash(const void *key, int len) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public interfaces must be prefixed with flb_, e.g: flb_hash_gen_hash
or flb_hash_generate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edsiper Done!
- Rename
gen_hash
toflb_hash_generate
.
Signed-off-by: zihengCat <[email protected]>
Is there any chance this might eventually be merged? |
Summary
It would be good if Fluent Bit supports strong data type condition check when applied in structured log stream. I implemented a data type condition checker for
Modify
filter.Check data type using
lua
filter isn't clear enough for end-user and costs more performance overhead.Usage
Modify
filter supports two new conditions. Seemodify_filter_example.conf
below.true
ifKEY
exists and its value data type isVALUE
.true
ifKEY
exists and its value data type is notVALUE
.Parameter 2 data type string literal could be:
null
bool
number
int
float
str
array
map
Unit Tests
Here comes unit testing results.
Addresses
#2530
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Documentation
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.