filebeat - 带有条件的 filebeat add_fields 处理器
问题描述
我想在 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 中称为“event.dataset”,但在 Graylog 中显示为“event_dataset”。
推荐阅读
- javascript - MaterialUI GridListTile中的两个IconButtons
- c# - WPF 从后台线程更新 UI
- python-3.x - Python.3 - np.where 而不是 For 循环
- firebase - Firestore 文档中子集合的更改是否会触发父文档的 EventListeners?
- deserialization - 反序列化不正确的字符串数组?
- tvos - TvOs:有没有办法知道电视何时关闭/打开?
- c# - 如何模拟ctrl+enter
- firebase - Firebase 警报订阅:没有 Crashlytics 设置
- python - 如果我想预测数字序列中的下一个元素,我需要将什么作为第二个参数传递给 Keras 的 fit 方法?
- ios - 使用应用内购买测试 macos Catalyst 应用的适当方法?