filebeat add_fields处理器有条件

问题描述 投票:0回答:1

我想在Filebeat“apache”模块导出到Graylog的每一行中添加一个值为“apache-access”的字段“app”。

以下配置应该添加字段,因为我在Graylog中看到“event_dataset”=“apache.access”字段但是没有做任何事情。如果我删除条件,“add_fields”处理器会添加一个字段。

filebeat.inputs:
- type: log
  enabled: false
  paths:
    - /var/log/*.log
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
setup.template.settings:
  index.number_of_shards: 1
setup.kibana:
output.logstash:
  hosts: [ "localhost:5044" ]

processors:
- add_fields:
    when:
      equals:
        event_dataset: "apache.access"
    target: ""
    fields:
      app: "apache-access"

logging.level: info
filebeat
1个回答
0
投票

无论出于何种原因,该字段在filebeat中称为“event.dataset”,但在Graylog中显示为“event_dataset”。

© www.soinside.com 2019 - 2024. All rights reserved.