一、下载
下载地址:https://www.elastic.co/cn/downloads/beats/filebeat
二、解压
tar xzvf filebeat-7.15.2-linux-x86_64.tar.gz
三、将解压包移至/usr/local
mv filebeat-7.15.2-linux-x86_64 /usr/local/
四、修改配置文件
vi filebeat.yml
修改为:
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /home/source/api/logs/*.out
output.logstash:
# The Logstash hosts
hosts: ["localhost:5044"]
五、启动
nohup ./filebeat -e -c filebeat.yml >/dev/null 2>&1 &