Filebeat 7.1.1 安裝及使用(連接ES)


1. 下載 & 解壓

# 下載
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.1.1-linux-x86_64.tar.gz
# 解壓
tar xvf filebeat-7.1.1-linux-x86_64.tar.gz
# 軟鏈
ln -s filebeat-7.1.1-linux-x86_64 filebeat

2. 配置 filebeat.yml

vim filebeat.yml

# 詳情如下:
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /data/action_log/*.log
  scan_frequency: 10s

# 7.x的版本中需要禁用此索引生命周期,否則在指定es索引名字的時候會有問題
setup.ilm.enabled: false
# 添加模板配置,否則無法指定es的索引名
setup.template.name: "actionlog"
setup.template.pattern: "actionlog-*"

output.elasticsearch:
  #worker: 1
  #bulk_max_size: 1500
  hosts: ["10.240.0.6:9200", "10.240.0.7:9200", "10.240.0.8:9200"]
  index: "actionlog-%{+yyyy.MM.dd}"
  #pipeline: "actionlog"

# Logging
logging.level: warning
logging.to_files: true

3. 啟動

./filebeat -e -c filebeat.yml

參考

  1. https://www.cnblogs.com/cjsblog/p/9495024.html


免責聲明!

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



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