Skip to content

feat: add raw format and rawLogKey support for Fluent Bit Kafka#2000

Open
Vaibhav-C-S wants to merge 6 commits into
fluent:masterfrom
Vaibhav-C-S:fluentbit-kafka-raw-log-key
Open

feat: add raw format and rawLogKey support for Fluent Bit Kafka#2000
Vaibhav-C-S wants to merge 6 commits into
fluent:masterfrom
Vaibhav-C-S:fluentbit-kafka-raw-log-key

Conversation

@Vaibhav-C-S

Copy link
Copy Markdown

What this PR does / why we need it:

Adds support for Fluent Bit Kafka raw output mode in fluent-operator.

Fluent Bit's Kafka output supports Format raw together with Raw_Log_Key, where the value of the configured record key is sent as the Kafka message payload. However, fluent-operator's Kafka output spec did not expose rawLogKey, and the documented format options did not include raw.

This PR adds support for:

  • kafka.format: raw
  • kafka.rawLogKey

Which issue(s) this PR fixes:

Fixes #1878

Does this PR introduced a user-facing change?

Added support for Fluent Bit Kafka raw output mode, allowing users to configure `format: raw` with `rawLogKey` to send a selected record field as the Kafka message payload.

Additional documentation, usage docs, etc.:


Testing

Testing

  • Ran make test
  • Tested locally on Minikube with Fluent Operator and Kafka
  • Verified ClusterOutput accepts kafka.rawLogKey
  • Verified generated Fluent Bit config contains
[Output]
    Name    kafka
    Match    dummy.*
    Format    raw
    Raw_Log_Key    log
    Brokers    kafka.kafka-test.svc.cluster.local:9092
    Topics    test

Message received at kafka consumer:
Input

[Input]
    Name    dummy
    Tag    dummy.test
    Dummy    {"log":"hello raw kafka from fluent-operator"}

Message received at kafka consumer

hello raw kafka from fluent-operator

Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
Copilot AI review requested due to automatic review settings June 20, 2026 02:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Fluent Operator’s Fluent Bit Kafka output plugin surface area to support Fluent Bit’s raw output mode, enabling users to send a selected record field as the Kafka message payload via Raw_Log_Key.

Changes:

  • Add rawLogKey to the Kafka output plugin API and render it as Raw_Log_Key in generated Fluent Bit config.
  • Document format: raw and rawLogKey in the Kafka output plugin docs.
  • Regenerate CRDs and bundled manifests/Helm CRDs to include the new field and updated format description.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
manifests/setup/setup.yaml Regenerated install manifest to include raw in format description and add rawLogKey schema/docs.
docs/plugins/fluentbit/output/kafka.md Document format: raw and rawLogKey in the Kafka output plugin doc table.
config/crd/bases/fluentbit.fluent.io_outputs.yaml Regenerated CRD base for Output to include rawLogKey and updated format description.
config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml Regenerated CRD base for ClusterOutput to include rawLogKey and updated format description.
charts/fluent-operator/crds/fluentbit.fluent.io_outputs.yaml Regenerated Helm CRD for Output with rawLogKey and updated format description.
charts/fluent-operator/crds/fluentbit.fluent.io_clusteroutputs.yaml Regenerated Helm CRD for ClusterOutput with rawLogKey and updated format description.
charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_outputs.yaml Regenerated Fluent Bit CRD chart template for Output with rawLogKey and updated format description.
charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_clusteroutputs.yaml Regenerated Fluent Bit CRD chart template for ClusterOutput with rawLogKey and updated format description.
apis/fluentbit/v1alpha2/plugins/output/kafka_types.go Add RawLogKey to the Kafka output API and emit Raw_Log_Key in Params.

Comment on lines +15 to +18
// Specify data format, options available: json, msgpack, raw.
Format string `json:"format,omitempty"`
// When using the raw format, the value of raw_log_key in the record is sent to Kafka as the payload.
RawLogKey string `json:"rawLogKey,omitempty"`
Comment thread docs/plugins/fluentbit/output/kafka.md Outdated
| ----- | ----------- | ------ |
| format | Specify data format, options available: json, msgpack. | string |
| format | Specify data format, options available: json, msgpack, raw. | string |
| rawLogKey | When using the raw format, the value of raw_log_key in the record is sent to Kafka as the payload. | string |
Copilot AI review requested due to automatic review settings June 22, 2026 17:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread apis/fluentbit/v1alpha2/plugins/output/kafka_types.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vaibhav Cheruvu <123824888+Vaibhav-C-S@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 22, 2026 17:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comment thread docs/plugins/fluentbit/output/kafka.md Outdated
| ----- | ----------- | ------ |
| format | Specify data format, options available: json, msgpack. | string |
| format | Specify data format, options available: json, msgpack, raw. | string |
| rawLogKey | When using the `raw` format, the value of `raw_log_key` in the record is sent to Kafka as the payload. | string |
Comment on lines +2280 to +2282
rawLogKey:
description: When using the raw format, the value of raw_log_key
in the record is sent to Kafka as the payload.
Comment on lines +2280 to +2282
rawLogKey:
description: When using the raw format, the value of raw_log_key
in the record is sent to Kafka as the payload.
Comment on lines +15 to 16
// Specify data format, options available: json, msgpack, raw.
Format string `json:"format,omitempty"`
Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
Copilot AI review requested due to automatic review settings June 22, 2026 18:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

// Specify data format, options available: json, msgpack.
// Specify data format, options available: json, msgpack, raw.
Format string `json:"format,omitempty"`
// When using the raw format, the value of the record field specified by RawLogKey is sent to Kafka as the payload.
Comment on lines +65 to +67
if k.RawLogKey != "" {
kvs.Insert("Raw_Log_Key", k.RawLogKey)
}
Comment on lines +65 to +67
if k.RawLogKey != "" {
kvs.Insert("Raw_Log_Key", k.RawLogKey)
}
| ----- | ----------- | ------ |
| format | Specify data format, options available: json, msgpack. | string |
| format | Specify data format, options available: json, msgpack, raw. | string |
| rawLogKey | When using the raw format, the value of the record field specified by RawLogKey is sent to Kafka as the payload. | string |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fluentbit(kafka): Add support for format:raw and raw_log_key

2 participants