【发布时间】:2020-11-27 12:09:30
【问题描述】:
您好,我正在尝试从不同的日志路径中过滤所有包含指示符“TEST01”的消息,并根据 fields.type 将消息发送到两个不同的主题(主题 1 和主题 2)
如果 fields.type 是“first_test”,那么消息应该转到“topic1”,否则转到“topic2”。下面是我尝试过的代码 - 但 and: 运算符不起作用。感谢有关在 filebeat -dynamic kafka 输出中编码复合条件的任何帮助。谢谢https://www.elastic.co/guide/en/beats/filebeat/master/defining-processors.html#condition-equals
topics:
- topic: "topic1"
and:
- when.contains:
message: "TEST01"
- equals:
fields.type: "first_test"
- topic: "topic2"
and:
- when.contains:
message: "TEST01"
- not:
equals:
fields.type: "first_test"
【问题讨论】: