身安不如心安,屋宽不如心宽 。

file beat采集日志中的agent.id值被filebeat保留字段覆盖

Beats | 作者 gary | 发布于2019年07月31日 | 阅读数:2748

filebeat采集日志时,发现输出到elasticsearch的agent.id值与log文件中不符
发现agent.id是ECS中agent的保留字段
因为该日志对应kibana插件,agent.id为重要筛选条件
有什么办法可以不被覆盖么
已邀请:

gary - 入坑小菜

赞同来自:

processors:
- decode_json_fields:
fields: ['message']
process_array: true
max_depth: 200
target: ''
overwrite_keys: true
- drop_fields:
fields: ['message', 'ecs', 'beat', 'input_type', 'tags', 'count', '@version', 'log', 'offset', 'type', 'host']
- rename:
fields:
- from: "data.aws.sourceIPAddress"
to: "@src_ip"
ignore_missing: true
fail_on_error: false
when:
regexp:
data.aws.sourceIPAddress: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
- rename:
fields:
- from: "data.srcip"
to: "@src_ip"
ignore_missing: true
fail_on_error: false
when:
regexp:
data.srcip: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
- rename:
fields:
- from: "data.win.eventdata.ipAddress"
to: "@src_ip"
ignore_missing: true
fail_on_error: false
when:
regexp:
data.win.eventdata.ipAddress: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
已解决

要回复问题请先登录注册