在Ubuntu上进行Filebeat日志传输,可按以下步骤操作:
sudo apt-get update
和sudo apt-get install filebeat
安装。/etc/filebeat/filebeat.yml
,在filebeat.inputs
部分指定要采集的日志文件路径,如paths: - /var/log/*.log
;在output
部分配置输出目标,如输出到Elasticsearch可设置output.elasticsearch: hosts: ["localhost:9200"]
。sudo systemctl start filebeat
启动服务,sudo systemctl enable filebeat
设置为开机自启。sudo systemctl status filebeat
查看服务状态,或查看Filebeat日志文件/var/log/filebeat/filebeat
确认是否正常运行。