filebeat直接给es传输日志,自定义索引名,自定义多个索引文件

官方文档地址:
https://www.elastic.co/guide/en/beats/filebeat/7.3/elasticsearch-output.html
https://www.elastic.co/guide/en/beats/filebeat/7.3/defining-processors.html#condition-contains

filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /opt/kidx/deploy/talk-skills/logs/skills_consumer.log
  fields:
    type: skills_consumer
- type: log
  enabled: true
  paths:
    - /opt/kidx/deploy/talk-skills/logs/skills_storage.log
  fields:
    type: skills_storage

setup.ilm.enabled: false

setup.template.settings:
  index.number_of_shards: 1
  index.number_of_replicas: 0
  index.codec: best_compression 

output.elasticsearch:
  hosts: ["192.168.3.210:9400"]
  indices:
    - index: "skills_consumer_%{+yyyy.MM.dd}"
      when.equals:
        fields.type: "skills_consumer"
    - index: "skills_storage_%{+yyyy.MM.dd}"
      when.equals:
        fields.type: "skills_storage"
原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/12894006.html