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

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"

 

posted @ 2022-02-09 14:19  飞鹰之歌  阅读(572)  评论(0)    收藏  举报