Filebeat在Debian中的配置步骤如下:
sudo apt update
和sudo apt install filebeat
;也可下载.deb包安装,如wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.6.2-amd64.deb
,然后执行sudo dpkg -i filebeat-8.6.2-amd64.deb
。/etc/filebeat/filebeat.yml
。在filebeat.inputs
部分指定要监控的日志文件路径,如paths: - /var/log/*.log
;在output.elasticsearch
部分配置输出目标,如hosts: ["localhost:9200"]
,还可根据需要添加处理器等配置。sudo systemctl start filebeat
启动服务,sudo systemctl enable filebeat
设置开机自启。sudo systemctl status filebeat
检查服务状态,或查看日志文件/var/log/filebeat/filebeat
排查问题。