我想省略 filebeat 添加的
agent.id
和 agent.type
字段(默认情况下)。我尝试过 drop_fields
处理器,但没有成功。我正在使用filebeat 7.16.3
。请告诉我如何删除这些字段?
以下是 filebeat.yml
文件:
filebeat.inputs:
- input_type: log
paths: [/var/log/log.json]
scan_frequency: 3m
processors:
- drop_fields:
fields: ["agent.type", "agent.id"]
- decode_json_fields:
fields: ["message"]
process_array: false
max_depth: 1
target: ""
overwrite_keys: false
add_error_key: true
fields:
topic: logs
output.kafka:
hosts: ["192.168.0.155:9092","192.168.0.155:9093","192.168.0.155:9094"]
topic: "%{[fields.topic]}"