1.filebeat收集本地日志到文件配置

[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"

2.启动

[root@web01 ~]# systemctl start filebeat.service

#验证
[root@web01 ~]# ps -ef | grep filebeat

3.测试

[root@web01 ~]# tail -f /tmp/filebeat_messages.log

#输入内容
[root@web01 ~]# echo "123" >> /var/log/messages

相关文章: