0%

Filebeat

簡介

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
2
3
4
5
cd /data/temp

wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.8.13-x86_64.rpm

rpm -ivh filebeat-6.8.13-x86_64.rpm

查詢filebeat的安裝目錄:

1
whereis filebeat

顯示:

filebeat: /usr/bin/filebeat /etc/filebeat /usr/share/filebeat

修改配置:

1
2
3
cp  /etc/filebeat/filebeat.yml   /etc/filebeat/filebeat.yml_bak

vi /etc/filebeat/filebeat.yml

收集tomcat的日志,內容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
filebeat.inputs:
- type: log
enabled: true
paths:
- /data/temp/apache-tomcat/logs/*.log
#- c:\programdata\elasticsearch\logs\*

output.logstash:
#輸出到logstash的ip地址和端口
hosts: ["192.168.43.128:5044"]

processors:
- add_host_metadata: ~
- add_cloud_metadata: ~

啟動:

1
2
3
systemctl start filebeat

systemctl status filebeat

停止:

1
systemctl stop filebeat
layicr 微信支付

微信支付

layicr 支付寶

支付寶