You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your main configuration file append the following `Input` and `Output` sections:
35
+
In your main configuration file append the following:
36
+
37
+
{% tabs %}
38
+
{% tab title="fluent-bit.yaml" %}
39
+
40
+
```yaml
41
+
pipeline:
42
+
inputs:
43
+
- name: kafka
44
+
brokers: 192.168.1.3:9092
45
+
topics: some-topic
46
+
poll_ms: 100
47
+
48
+
outputs:
49
+
- name: stdout
50
+
match: '*'
51
+
```
52
+
53
+
{% endtab %}
54
+
{% tab title="fluent-bit.conf" %}
36
55
37
56
```text
38
57
[INPUT]
@@ -43,12 +62,43 @@ In your main configuration file append the following `Input` and `Output` sectio
43
62
44
63
[OUTPUT]
45
64
Name stdout
65
+
Match *
46
66
```
47
67
68
+
{% endtab %}
69
+
{% endtabs %}
70
+
48
71
#### Example of using Kafka input and output plugins
49
72
50
73
The Fluent Bit source repository contains a full example of using Fluent Bit to process Kafka records:
51
74
75
+
{% tabs %}
76
+
{% tab title="fluent-bit.yaml" %}
77
+
78
+
```yaml
79
+
pipeline:
80
+
inputs:
81
+
- name: kafka
82
+
brokers: kafka-broker:9092
83
+
topics: fb-source
84
+
poll_ms: 100
85
+
format: json
86
+
87
+
filters:
88
+
- name: lua
89
+
match: '*'
90
+
script: kafka.lua
91
+
call: modify_kafka_message
92
+
93
+
outputs:
94
+
- name: kafka
95
+
brokers: kafka-broker:9092
96
+
topics: fb-sink
97
+
```
98
+
99
+
{% endtab %}
100
+
{% tab title="fluent-bit.conf" %}
101
+
52
102
```text
53
103
[INPUT]
54
104
Name kafka
@@ -69,10 +119,13 @@ The Fluent Bit source repository contains a full example of using Fluent Bit to
69
119
topics fb-sink
70
120
```
71
121
122
+
{% endtab %}
123
+
{% endtabs %}
124
+
72
125
The previous example will connect to the broker listening on `kafka-broker:9092` and subscribe to the `fb-source` topic, polling for new messages every 100 milliseconds.
73
126
74
127
Since the payload will be in JSON format, the plugin is configured to parse the payload with `format json`.
75
128
76
129
Every message received is then processed with `kafka.lua` and sent back to the `fb-sink` topic of the same broker.
77
130
78
-
The example can be executed locally with `make start` in the `examples/kafka_filter` directory (`docker/compose` is used).
131
+
The example can be executed locally with `make start` in the `examples/kafka_filter` directory (`docker/compose` is used).
0 commit comments