Skip to content
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

Add support for Kafka "raw" format for the payload #1727

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gavin-shr
Copy link

The existing "format" configuration for the Kafka output plugin will put
into the Kafka payload part a message in JSON format, MSGPACK format,
or GELF format. In the JSON and MSGPACK formats this sends all the
variables in the internal format, includes creating timestamp variable.
This means that the clients which get the payload from the broker need
to use these formats to extract the data, and also need to know the
variables encoded in the data.

This patch adds an option for a "raw" format (configured using the Kafka
output plugin "Format" configuration variable). This is to allow for
any other format of the Kafka payload, which can be formed by either an
input or filter plugin. For example, this could be used for sending a
payload in Google Protobuf format. When using format "raw" by default,
it will look for a variable named "payload" in the fluent-bit internal
MSGPACK packet information, and send the contents as the Kafka payload.
However, the configuration variable "Raw_Key" can be used to give the
name of the variable containing the Kafka payload information (instead
of using name "payload").

The existing "format" configuration for the Kafka output plugin will put
into the Kafka payload part a message in JSON format, MSGPACK format,
or GELF format. In the JSON and MSGPACK formats this sends all the
variables in the internal format, includes creating timestamp variable.
This means that the clients which get the payload from the broker need
to use these formats to extract the data, and also need to know the
variables encoded in the data.

This patch adds an option for a "raw" format (configured using the Kafka
output plugin "Format" configuration variable). This is to allow for
any other format of the Kafka payload, which can be formed by either an
input or filter plugin. For example, this could be used for sending a
payload in Google Protobuf format. When using format "raw" by default,
it will look for a variable named "payload" in the fluent-bit internal
MSGPACK packet information, and send the contents as the Kafka payload.
However, the configuration variable "Raw_Key" can be used to give the
name of the variable containing the Kafka payload information (instead
of using name "payload").

Signed-off-by: Gavin Shearer <[email protected]>
@edsiper
Copy link
Member

edsiper commented May 5, 2020

thanks for your contribution.

would you please rebase on top of GIT master so we can test it ?

@edsiper edsiper self-assigned this May 5, 2020
@edsiper edsiper added the waiting-for-user Waiting for more information, tests or requested changes label May 5, 2020
@edsiper
Copy link
Member

edsiper commented Jun 30, 2020

ping

@t0rr3sp3dr0
Copy link

Any updates on this PR?

@vitalvi
Copy link

vitalvi commented Jul 27, 2022

Hey,
I came across this PR and I find it quite useful for my use case but it seems to be a bit forgotten. Can we have it merged?

@clotha
Copy link

clotha commented Sep 6, 2023

This PR needs some attention. Not being able to send raw protobuf to kafka is the main reason we cannot switch to fluentbit now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-user Waiting for more information, tests or requested changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants