sudo yum install filebeat
。/etc/filebeat/filebeat.yml
,在filebeat.inputs
中指定應用日志路徑,如paths: ["/var/log/myapp/*.log"]
。output.elasticsearch
中設置Elasticsearch地址,如hosts: ["localhost:9200"]
。sudo systemctl start filebeat
并設置開機自啟sudo systemctl enable filebeat
。sudo journalctl -u filebeat -f
查看日志,或在Kibana中確認數據是否正常接收。