-
Notifications
You must be signed in to change notification settings - Fork 2.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
[exporter/syslog] Fix handling of multiple structured data elements #37927
Conversation
The current syslog exporter does not handle structured data well. In particular, when there is more than one structured data field, it will put them all in one structured data block rather than in one block per field as the RFC5424 suggests. This test is a test for this error.
…ata block is built up as its own array (rather than as one single array as it was done before). String builder (strings.Builder) was used to buffer the final string that is built up.
Hello @peffis, thanks for your contribution! To be able to move this PR forward the CLA must be signed. Feel free to reach out if you have any questions! |
I think (hope) that is checked off now (took some time for me to get clearance from my company admins) |
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.
LGTM! thank you for contributing! 🚀
Description
As reported in issue #33300 this fixes the issue when there are more than one structured data block in the structured_data attributes object. Say you had a structured block like this:
The expected output would then be two sd blocks, like [a@193 a="123"][b@193 b="321"]
, but instead the code returns one array, like [a@193 a="123" b@193 b="321"] which is wrong according to the
RFC5424
Link to tracking issue
Fixes #33300
Testing
A new test for "more than one SD field" was added in the commit, which failed for the original code, but passes now with the fix.
Documentation
No documentation change needed.