-
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
Kafka Input can't handle json data #7481
Comments
@JackJiaJJ I'm working on a fix, but I will also switch the implementation to use a configuration key for deciding if JSON should be parsed. What should be the default in your opinion? Is JSON the most common data format for kafka? If so I could set the parse behavior as being the default. |
@tarruda From my option, most of the projects using JSON as a data exchange format (not only with Kafka), so we prefer JSON as the default. @JackJiaJJ FYI |
I would second the above and with the adoption of Open Telemetry I'd imagine many companies are moving to adopt JSON |
Temporary workaround:
With this setup, you can get the json parse behaviour by setting up a filter with a json parser https://docs.fluentbit.io/manual/pipeline/filters/parser I actually needed avro parsing and spent extra effort to produce json, so would prefer customizable parsing vs default json. Would also find arrow processing useful. |
It seems like the issue with that PR is that he should've used |
Created #7492 to fix the issue (thanks @leonardo-albertovich for the quick parsing fix). Also added @JackJiaJJ can you check that branch and LMK if all is good? |
Hello, is any news about this fix? When would be available? |
Once it is merged it will be in the next nightly build if you want to try it (these are not for production obviously): https://github.com/fluent/fluent-bit/tree/master/.github/workflows#unstablenightly-builds It will then be in the next 2.1 series release after merging.
Please look at the PR, it includes an example from @tarruda. |
Hi, is there an estimated release date that includes a solution for this issue? |
Bug Report
Describe the bug
@tarruda we just built an image with latest code (it includes kafka input), it can work well with plain text, but can't work well with json, please see below:
I defined Input Kafka, Output cloudwatch log group and stdout below is the configuration:
$ ./kafka-console-producer.sh --broker-list $myKafkaServer --producer.config client.properties --topic $myKafkaTopic
>test only
I can get the text in aws log group:
if I produce json data, like below:
>"{\"name\":\"jiajj\"}"
or
>{"name":"jack"}
It can't work, from log group, you can see the payload doesn't exist:
Would you please give some advice about it ? thanks !
To Reproduce
Expected behavior
Screenshots
Your Environment
Additional context
The text was updated successfully, but these errors were encountered: