filebeat.yml配置


#=========================== Filebeat inputs =============================

filebeat.inputs:

- type: log
  enabled: true     #默認為false,修改為true則啟用該配置
  paths:
    - /home/logs/*.log
  fields:
    filetype: test1    #自定義字段,用來區分多個類型日志
  fields_under_root: true    #如果該選項設置為true,則新增fields成為頂級目錄,而不是將其放在fields目錄下

#============================= Filebeat modules ===============================

filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false

#==================== Elasticsearch template setting ==========================

setup.template.settings:
  index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false

#================================ Outputs =====================================
#直接將log數據傳輸到Elasticsearch
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]
  username: "elastic"
  password: "elastic"

#----------------------------- Logstash output --------------------------------
#將log數據傳輸到logstash
#先啟動logstash,不然的話filebeat會找不到logstash的5044端口 output.logstash: # The Logstash hosts hosts: ["localhost:5044"]

 


免責聲明!

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



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