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中确认数据是否正常接收。