filebeat收集本地日志到文件

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
posted @ 2020-08-22 15:23  等等马上就好  阅读(860)  评论(0)    收藏  举报