在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确认是否正常运行。