在CentOS系統集成Filebeat可參考以下步驟:
wget
命令從Elastic官方網站下載適用于CentOS的Filebeat軟件包,如wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.14.0-x86_64.rpm
,然后使用sudo rpm -vi filebeat-7.14.0-x86_64.rpm
進行安裝。/etc/filebeat/filebeat.yml
文件,指定要監控的日志文件路徑,如filebeat.inputs: - type: log enabled: true paths: - /var/log/*.log
,并配置輸出到Elasticsearch的地址和端口,如output.elasticsearch: hosts: - "localhost:9200"
。sudo systemctl start filebeat
命令啟動服務,并通過sudo systemctl enable filebeat
設置為開機自啟動。/var/log/filebeat/filebeat.log
日志文件,確認Filebeat是否正常運行,也可登錄Kibana查看日志數據是否成功發送。