[root@web01 ~]# vim /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: log
enable: true
paths:
- /var/log/messages
output.file:
path: "/tmp"
filename: "filebeat_messages.log"
[root@web01 ~]# systemctl start filebeat.service
#验证
[root@web01 ~]# ps -ef | grep filebeat
[root@web01 ~]# tail -f /tmp/filebeat_messages.log
#输入内容
[root@web01 ~]# echo "123" >> /var/log/messages
原文:https://www.cnblogs.com/Applogize/p/13545808.html