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