-
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
[kubernetes filter] a json log object containing a string value that is the serialization of a json object should be preserved in that form #1130
Comments
Also as per @Flydiverny on the slack channel
|
As per @sjentzsch in slack channel:
|
Indeed I can relate. If our applications log JSON that contains escaped strings or JSON itself (properly escaped!), the parsing of the |
Thanks @sjentzsch , was not sure if it was es ouput or kubernetes filter actually. Title adjusted! |
Seems the error is in flb_unescape_string(), which is called from merge_log_handler when Merge_Log is on. |
So somewhere here essentially? fluent-bit/plugins/filter_kubernetes/kubernetes.c Lines 140 to 174 in fe09b4c
|
it flows down through flb_pack_json() and then to flb_json_tokenise(). making a 'fix' to flb_unescape, it still ends up w/ a tokenise issue since jsmn doesn't understand nested. |
Please check the following comment on #1278 : |
Thanks @edsiper will switch back to fluent-bit from fluentd soon to test this out |
Issue already fixed, ref: #1278 (comment) |
Bug Report
Describe the bug
We serialize log messages as json, and some messages contain fields that are themselves the serialization of a json object. In this case, we are seeing that the escaped quotes of the serialized json are unescaped before being output to elastic search, resulting in a string that is no longer valid json. We believe the problem is in the elasticsearch output, because we do not see an issue when testing fluent-bit and outputting locally.
To Reproduce
Use json parser on this log and send to Elastic Search using es output
Expected behavior
a json log object containing a string value that is the serialization of a json object should be preserved in that form, as a string that includes escaped quote characters.
Your Environment
Additional context
The text was updated successfully, but these errors were encountered: