filebeat 监控多个文件,并且写入不同 index的 elasticsearch中

filebeat.prospectors:
- input_type: log
  paths:
    - /home/user/website/log/aaaa.log
  json.keys_under_root: true
  json.overwrite_keys: true
  fields:
    index: 'aaaa_history'

- input_type: log
  paths:
    - /home/user/website/log/bbbb_history.log
  json.keys_under_root: true
  json.overwrite_keys: true
  fields:
    index: 'bbbb_history'

output.elasticsearch:
  hosts: ["172.16.0.40:9200"]
  indices:
    - index: "bbbb_history"
      when.contains:
        fields:
          index: "bbbb_history"
    - index: "aaaa_history"
      when.contains:
        fields:
          index: "aaaa_history"

你可能感兴趣的:(filebeat 监控多个文件,并且写入不同 index的 elasticsearch中)