ELK6.5 Nginx 日誌蒐集-05 filebeat 安裝
阿新 • • 發佈:2018-12-07
node1:elasticsearch、kibana、logstash
node2:filebeat
1、如前文,下載 filebeat 6.5.0 版 在 node2 節點安裝
filebeat 的安裝,執行,是不需要 jdk 環境的
# rpm -ivh filebeat-6.5.0-x86_64.rpm
進入配置檔案目錄,修改配置檔案
# cd /etc/filebeat/ # vim filebeat.yml (yml 檔案,對格式要求比較嚴謹)
[[email protected]filebeat]# cat filebeat.yml |egrep -v "*#|^$" filebeat.inputs: - type: log enabled: false paths: - /var/log/*.log processors: - drop_fields: fields: ["input", "offset", "prospector"] filebeat.config.modules: path: ${path.config}/modules.d/*.yml reload.enabled: false name: node2 output.logstash: hosts: ["192.168.1.113:5044"]
我搜集的是 nginx 日誌,所以,直接使用模板了。
# cd /etc/filebeat/modules.d/
# mv nginx.yml.disabled nginx.yml
[[email protected] modules.d]# vim nginx.yml - module: nginx # Access logs access: enabled: true # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. #var.paths: var.paths: [/var/log/nginx/access.log] # Error logs error: enabled: true # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. #var.paths: var.paths: [/var/log/nginx/error.log]
啟動 filebeat
# /etc/init.d/filebeat start
寫的不好、歡迎指正:VX:85862870