温馨提示×

ubuntu filebeat怎样进行日志传输

小樊
44
2025-09-17 06:26:36
栏目: 智能运维

在Ubuntu上进行Filebeat日志传输,可按以下步骤操作:

  1. 安装Filebeat:使用命令sudo apt-get updatesudo apt-get install filebeat安装。
  2. 配置Filebeat:编辑配置文件/etc/filebeat/filebeat.yml,在filebeat.inputs部分指定要采集的日志文件路径,如paths: - /var/log/*.log;在output部分配置输出目标,如输出到Elasticsearch可设置output.elasticsearch: hosts: ["localhost:9200"]
  3. 启动和启用Filebeat:使用sudo systemctl start filebeat启动服务,sudo systemctl enable filebeat设置为开机自启。
  4. 验证配置:通过sudo systemctl status filebeat查看服务状态,或查看Filebeat日志文件/var/log/filebeat/filebeat确认是否正常运行。

0