在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
確認是否正常運行。