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
This commit updates the documentation from the Kafka output on
standalone Elastic-Agent settings by removing the options that are not
supported any more.
Use these options to dynamically set the Kafka topic for each {agent} event.
198
+
Use these options to set the Kafka topic for each {agent} event.
200
199
201
200
[cols="2*<a"]
202
201
|===
@@ -208,61 +207,9 @@ Use these options to dynamically set the Kafka topic for each {agent} event.
208
207
209
208
| The default Kafka topic used for produced events.
210
209
211
-
You can set the topic dynamically by using a format string to access any event field. For example, this configuration uses a custom field, `fields.log_topic`, to set the topic for each event:
| One or more topic processors including a condition, the event value to check against, and the resulting Kafka topic.
225
-
226
-
Events that don't match against any defined processor are set to the default topic.
227
-
228
-
Rule settings:
229
-
230
-
`topic`::
231
-
The topic format string to use. If this string contains field references, such as `%{[fields.name]}`, the fields must exist, or the rule fails.
232
-
233
-
`mappings`::
234
-
A dictionary that takes the value returned by `topic` and maps it to a new name.
235
-
236
-
`default`::
237
-
The default string value to use if `mappings` does not find a match.
238
-
239
-
`when`::
240
-
A condition that must succeed in order to execute the current rule. Refer to <<processor-conditions,conditions>> in the Elastic Agent processor syntax for condition descriptions. Currently the equals, contains, and regexp conditions are available.
241
-
242
-
As an example for setting up your processors, you might want to route log events based on severity. To do so, you can specify a default topic for all events not matched by other processors:
243
-
244
-
[source,yaml]
245
-
----
246
-
outputs:
247
-
kafka-output:
248
-
type: kafka
249
-
hosts:
250
-
- 'kafka1:9092'
251
-
- 'kafka2:9092'
252
-
- 'kafka3:9092'
253
-
topics:
254
-
- topic: 'critical-%{[agent.version]}'
255
-
when:
256
-
contains:
257
-
message: ' “CRITICAL”'
258
-
- topic: 'error-%{[agent.version]}'
259
-
when:
260
-
contains:
261
-
message: ' “ERR”'
262
-
- topic: '%{[fields.log_topic]}'
263
-
----
264
-
265
-
All non-critical and non-error events will then route to the default `%{[fields.log_topic]}` topic.
0 commit comments