You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Due to the way the rewrite_tag plugin does a record accessor check, using $TAG as the KEY in the rewrite_tag rule does not work. As far as I can tell, it is not possible to refer to the tag in the KEY part of the rule.
To Reproduce
[INPUT]
name dummy
# dummy {"tag": "x"}
tag x
[FILTER]
name rewrite_tag
# rule $tag ^(x)$ y true
rule $TAG ^(x)$ y true
match x
[OUTPUT]
match *
name stdout
Expected behavior
This should produce 2 logs each dummy interval, one with tag x and one with tag y. With either rule in rewrite_tag, it does not work. The result is the same:
I have both $TAG and $tag as options because I have seen people reference $tag as the way to refer to the tag of the log record itself, though skimming through the docs I am having trouble finding that mentioned anywhere. In either case though, both don't work.
As a test, I also tried a dummy log with tag as a key, and used the $tag rule. This works as expected:
Based on other usages of flb_ra_regex_match, perhaps this is just intended behaviour and this isn't meant to be possible. If that is the case, then this the outcome for this issue is probably just docs, because based on previous interactions I don't think I'm the only user confused by this.
The text was updated successfully, but these errors were encountered:
Bug Report
Describe the bug
Due to the way the
rewrite_tag
plugin does a record accessor check, using$TAG
as theKEY
in therewrite_tag
rule does not work. As far as I can tell, it is not possible to refer to the tag in theKEY
part of the rule.To Reproduce
Expected behavior
This should produce 2 logs each
dummy
interval, one with tagx
and one with tagy
. With either rule inrewrite_tag
, it does not work. The result is the same:I have both
$TAG
and$tag
as options because I have seen people reference$tag
as the way to refer to the tag of the log record itself, though skimming through the docs I am having trouble finding that mentioned anywhere. In either case though, both don't work.As a test, I also tried a dummy log with
tag
as a key, and used the$tag
rule. This works as expected:Screenshots
Your Environment
Additional context
This seems to happen because the
flb_regex_ra_match
is only run on the log body:fluent-bit/plugins/filter_rewrite_tag/rewrite_tag.c
Lines 356 to 381 in f5737c0
Based on other usages of
flb_ra_regex_match
, perhaps this is just intended behaviour and this isn't meant to be possible. If that is the case, then this the outcome for this issue is probably just docs, because based on previous interactions I don't think I'm the only user confused by this.The text was updated successfully, but these errors were encountered: