-
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
Should rewrite_tag
allow for a static new tag?
#7330
Comments
Static tag is allowed. Workaround is following rule (set characters)
|
Thank you @nokute78 that's very helpful. I think I found the bug, a calculation in |
Signed-off-by: Takahiro Yamashita <[email protected]>
No problem, thanks @nokute78! Looks like how I was intending to fix it anyway. |
@braydonk Thank you for reviewing. |
Thanks for fixing this! Backport issue is #7335 |
Signed-off-by: Takahiro Yamashita <[email protected]>
This patch is to allow a single character for `flb_ra_translate`. Currently, `flb_ra_translate` doesn't allow a single character and it causes a issue like #7330. Note: This is a backport of PR 7332 Signed-off-by: Aditya Prajapati <[email protected]> Co-authored-by: Takahiro Yamashita <[email protected]>
Bug Report
Describe the bug
It appears that using a static pattern for the new tag in
rewrite_tag
, aka one that does not use any record accesor functionality, will cause fluent bit to rewrite the tag as a blank string.To Reproduce
The best way to observe the behaviour is to first run Fluent Bit with this config, where you can see it work as expected:
In this scenario,
a.txt
is empty, andb.txt
contains:Next, run Fluent Bit with this slightly altered config:
In this scenario, both
b.txt
anda.txt
are empty. Changing the Rule inrewrite_tag
such that we keep the original log,a.txt
has the following:Expected behavior
I should be allowed to successfully rewrite a tag to something static without any record accesor functionality.
Your Environment
rewrite_tag
Additional context
I am almost certain the problem is in this function:
fluent-bit/src/flb_record_accessor.c
Line 613 in 5864c41
If the record accesor list is empty, it won't actually process anything, simply returning an
""
buf successfully. I tried to hack this by manually settingbuf
ifra->list
was found to be empty. It worked, though it caused a double free somewhere and I don't have time yet to determine what went wrong.The text was updated successfully, but these errors were encountered: