centos

Filebeat如何采集CentOS应用日志

小樊
39
2025-09-05 19:10:53
栏目: 智能运维

  1. 安装Filebeat:通过YUM安装,命令为sudo yum install filebeat
  2. 配置日志路径:编辑/etc/filebeat/filebeat.yml,在filebeat.inputs中指定应用日志路径,如paths: ["/var/log/myapp/*.log"]
  3. 配置输出目标:在output.elasticsearch中设置Elasticsearch地址,如hosts: ["localhost:9200"]
  4. 启动服务:执行sudo systemctl start filebeat并设置开机自启sudo systemctl enable filebeat
  5. 验证运行:通过sudo journalctl -u filebeat -f查看日志,或在Kibana中确认数据是否正常接收。

0
看了该问题的人还看了