簡介
Filebeat是用于轉發和集中日志數據的輕量級傳送工具。Filebeat監視您指定的日志文件或位置,收集日志事件,并將它們轉發到Elasticsearch或 Logstash進行索引。
網址:https://www.elastic.co/cn/beats/filebeat
環境情況
- Java:1.8
- Filebeat:6.8.13
- 操作系統:centos7
- IP:192.168.43.128
版本匹配
網址:https://www.elastic.co/cn/support/matrix#matrix_compatibility
安裝Filebeat
網址:https://www.elastic.co/cn/downloads/past-releases#filebeat
1 | cd /data/temp |
查詢filebeat的安裝目錄:
1 | whereis filebeat |
顯示:
filebeat: /usr/bin/filebeat /etc/filebeat /usr/share/filebeat
修改配置:
1 | cp /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.yml_bak |
收集tomcat的日志,內容如下:
1 | filebeat.inputs: |
啟動:
1 | systemctl start filebeat |
停止:
1 | systemctl stop filebeat |