Skip to content

Commit e4fa2ba

Browse files
authored
output: kafka: document new avro support in v1.9 (#571)
Signed-off-by: Brian McQueen <[email protected]>
1 parent b75d1f1 commit e4fa2ba

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

pipeline/outputs/kafka.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,70 @@ In your main configuration file append the following _Input_ & _Output_ sections
4747
Topics test
4848
```
4949

50+
### Avro Support
51+
52+
Fluent-bit comes with support for avro encoding for the out_kafka plugin.
53+
Avro support is optional and must be activated at build-time by using a
54+
build def with cmake: `-DFLB_AVRO_ENCODER=On` such as in the following
55+
example which activates:
56+
57+
* out_kafka with avro encoding
58+
* fluent-bit's prometheus
59+
* metrics via an embedded http endpoint
60+
* debugging support
61+
* builds the test suites
62+
63+
```
64+
cmake -DFLB_DEV=On -DFLB_OUT_KAFKA=On -DFLB_TLS=On -DFLB_TESTS_RUNTIME=On -DFLB_TESTS_INTERNAL=On -DCMAKE_BUILD_TYPE=Debug -DFLB_HTTP_SERVER=true -DFLB_AVRO_ENCODER=On ../
65+
```
66+
67+
#### Kafka Configuration File with Avro Encoding
68+
69+
This is example fluent-bit config tails kubernetes logs, decorates the
70+
log lines with kubernetes metadata via the kubernetes filter, and then
71+
sends the fully decorated log lines to a kafka broker encoded with a
72+
specific avro schema.
73+
74+
```text
75+
[INPUT]
76+
Name tail
77+
Tag kube.*
78+
Alias some-alias
79+
Path /logdir/*.log
80+
DB /dbdir/some.db
81+
Skip_Long_Lines On
82+
Refresh_Interval 10
83+
Parser some-parser
84+
85+
[FILTER]
86+
Name kubernetes
87+
Match kube.*
88+
Kube_URL https://some_kube_api:443
89+
Kube_CA_File /certs/ca.crt
90+
Kube_Token_File /tokens/token
91+
Kube_Tag_Prefix kube.var.log.containers.
92+
Merge_Log On
93+
Merge_Log_Key log_processed
94+
95+
[OUTPUT]
96+
Name kafka
97+
Match *
98+
Brokers 192.168.1.3:9092
99+
Topics test
100+
Schema_str {"name":"avro_logging","type":"record","fields":[{"name":"timestamp","type":"string"},{"name":"stream","type":"string"},{"name":"log","type":"string"},{"name":"kubernetes","type":{"name":"krec","type":"record","fields":[{"name":"pod_name","type":"string"},{"name":"namespace_name","type":"string"},{"name":"pod_id","type":"string"},{"name":"labels","type":{"type":"map","values":"string"}},{"name":"annotations","type":{"type":"map","values":"string"}},{"name":"host","type":"string"},{"name":"container_name","type":"string"},{"name":"docker_id","type":"string"},{"name":"container_hash","type":"string"},{"name":"container_image","type":"string"}]}},{"name":"cluster_name","type":"string"},{"name":"fabric","type":"string"}]}
101+
Schema_id some_schema_id
102+
rdkafka.client.id some_client_id
103+
rdkafka.debug All
104+
rdkafka.enable.ssl.certificate.verification true
105+
106+
rdkafka.ssl.certificate.location /certs/some.cert
107+
rdkafka.ssl.key.location /certs/some.key
108+
rdkafka.ssl.ca.location /certs/some-bundle.crt
109+
rdkafka.security.protocol ssl
110+
rdkafka.request.required.acks 1
111+
rdkafka.log.connection.close false
112+
113+
Format avro
114+
rdkafka.log_level 7
115+
rdkafka.metadata.broker.list 192.168.1.3:9092
116+
```

0 commit comments

Comments
 (0)