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"


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM