Skip to content

Commit 0e548b7

Browse files
authored
input: kafka: Document data_format option (#1118)
* input: kafka: Document `data_format` option Signed-off-by: Thiago Padilha <[email protected]> * Rename data_format to format Signed-off-by: Thiago Padilha <[email protected]> --------- Signed-off-by: Thiago Padilha <[email protected]>
1 parent 5c2bc16 commit 0e548b7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pipeline/inputs/kafka.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This plugin uses the official [librdkafka C library](https://github.com/edenhill
99
| :--- | :--- | :--- |
1010
| brokers | Single or multiple list of Kafka Brokers, e.g: 192.168.1.3:9092, 192.168.1.4:9092. | |
1111
| topics | Single entry or list of topics separated by comma \(,\) that Fluent Bit will subscribe to. | |
12+
| format | Serialization format of the messages. If set to "json", the payload will be parsed as json. | none |
1213
| client\_id | Client id passed to librdkafka. | |
1314
| group\_id | Group id passed to librdkafka. | fluent-bit |
1415
| poll\_ms | Kafka brokers polling interval in milliseconds. | 500 |
@@ -53,6 +54,7 @@ The fluent-bit source repository contains a full example of using fluent-bit to
5354
brokers kafka-broker:9092
5455
topics fb-source
5556
poll_ms 100
57+
format json
5658
5759
[FILTER]
5860
Name lua
@@ -68,6 +70,8 @@ The fluent-bit source repository contains a full example of using fluent-bit to
6870

6971
The above will connect to the broker listening on `kafka-broker:9092` and subscribe to the `fb-source` topic, polling for new messages every 100 milliseconds.
7072

73+
Since the payload will be in json format, we ask the plugin to automatically parse the payload with `format json`.
74+
7175
Every message received is then processed with `kafka.lua` and sent back to the `fb-sink` topic of the same broker.
7276

7377
The example can be executed locally with `make start` in the `examples/kafka_filter` directory (docker/compose is used).

0 commit comments

Comments
 (0)