filebeat.inputs:
# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- {some path}
fields:
target_index: import-export-logger
build_version: $build_version
这里我想在字段中添加build_version。我的build_version存储在每个服务器上的一个文件中。
filebeat可以读取文件并在字段中添加build_version吗?
1条答案
按热度按时间yr9zkbsy1#
如果需要添加
additional fields
,可以将以下行添加到filebeat.yml中https://www.elastic.co/guide/en/beats/filebeat/current/add-fields.html
如果需要解析日志并根据数据添加动态字段,则需要从日志中摄取和获取信息。
上述处理器将解析
message
字段,并创建key1、key2字段https://www.elastic.co/guide/en/beats/filebeat/current/dissect.html
注:
filebeat
中的解剖类似于logstash
中的grok。