-
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
Getting incorrect output from go output plugin when multiple filters match the same tag #9396
Comments
Can you explain how you've made the plugin? It's going to be super hard to debug unknown code particularly if it is a dependency or other issue. Is it this one? https://github.com/chronosphereio/calyptia-plugin/tree/main/examples/out_gstdout |
@patrick-stephens , It is this one: Also, I have validated another example plugin from the same repo that I attached above by adding a debug statement and found out that the decoded payload to the plugin is itself malformed. |
I bet the dependencies are wildly out of date: are you updating them before build? |
@patrick-stephens , I directly built the plugin using
Did not try updating any dependency |
I would try that then, it looks like the code has not changed for 2 years... |
@patrick-stephens , I tried updating the dependencies, still facing the same issue. |
Bug Report
Describe the bug
When multiple filters of type record_modifier are used, all of them matching the same tag, any key value pairs that are added using "Record" and have the same key across multiple filters , are interpreted incorrectly by any Go output plugin.
For example: If the records a: abc and a: xy, are added through the first and second filter respectively (as seen in config below),
the go output plugin is receiving the record a: xyc, instead of receiving both a: abc and a: xy.
To Reproduce
Use the following config in fluent-bit.conf
Expected behavior
The final output should contain all the 10 records that are added by both the filters. The plugin stdout (out-of-the-box C plugin) is behaving in the expected manner.
From the screenshot below, we can see the outputs from both stdout and gstdout (golang output plugin)
The first line in the snippet above shows the expected output (emitted by stdout plugin). The second line shows the output emitted by the golang output plugin.
Notice that the first log has all the records from both the filters. The second log also do have all the records, but the records with the same key are malformed. We got a: [120 121 99] which translates to a: "xyc" ( first two letters of "abc" got replaced with "xy").Also, notice that the record with key "filter" has been overwritten. This behaviour is observed by any output plugin that is written in go.
Link to output plugin that is used to reproduce the issue:
https://github.com/fluent/fluent-bit-go/tree/master/examples/out_gstdout
Screenshots
Your Environment
The text was updated successfully, but these errors were encountered: