out_kafka: add add_timestamp option to suppress timestamp field#11579
out_kafka: add add_timestamp option to suppress timestamp field#11579piyushka-ally wants to merge 1 commit intofluent:masterfrom
Conversation
The Kafka output plugin unconditionally injects an @timestamp field into every record when using json or msgpack formats. This prevents users from piping data through Fluent Bit into downstream Kafka consumers (e.g. JDBC sink connector) that enforce a strict schema, as the extra field causes schema mismatch errors. Add a new boolean config option `add_timestamp` (default: true) that controls whether the timestamp field is injected into the output record. When set to false, the field is omitted entirely. This is fully backward compatible — existing configurations are unaffected since the option defaults to true. Example usage to disable timestamp injection: [OUTPUT] Name kafka Match * Brokers localhost:9092 Topics my-topic add_timestamp false Signed-off-by: Piyush Kanti Chanda <piyush.chanda@databricks.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request introduces a new configuration option Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip Migrating from UI to YAML configuration.Use the |
The Kafka output plugin unconditionally injects an @timestamp field into every record when using json or msgpack formats. This prevents users from piping data through Fluent Bit into downstream Kafka consumers (e.g. JDBC sink connector) that enforce a strict schema, as the extra field causes schema mismatch errors.
Add a new boolean config option
add_timestamp(default: true) that controls whether the timestamp field is injected into the output record. When set to false, the field is omitted entirely.This is fully backward compatible — existing configurations are unaffected since the option defaults to true.
Example usage to disable timestamp injection:
Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit
add_timestampconfiguration option to the Kafka output plugin