环境
系统:CentOS 6.9
软件:filebeat-6.1.1-linux-x86_64.tar.gz
安装
-
安装
# tar -xzvf filebeat-6.1.1-linux-x86_64.tar.gz # mv filebeat-6.1.1-linux-x86_64 /usr/local/filebeat
配置
# cd /usr/local/filebeat/
# mv filebeat.yml filebeat.yml.org
# vim filebeat.yml
filebeat.prospectors:
- type: log
paths:
- /App/tomcat/my-project/logs/localhost.*.log
multiline.pattern: '^\s|^[A-Za-z]'
multiline.match: after
tail_files: true
fields_under_root: true
fields:
project: my-project
log_format: datatime-level-thread-class-content
fields_under_root: true
fields:
deployment: test
output.kafka:
hosts: ["elk-kafka-1:9092"]
topic: filebeat
version: 0.10.2.1
启动
-
开机启动
# vim /etc/rc.local cd /usr/local/filebeat/ && nohup ./filebeat >> logs/filebeat.log 2>&1 &
-
启动
# cd /usr/local/filebeat/ # nohup ./filebeat >> /tmp/filebeat.log 2>&1 &
网友评论