在Debian上部署Filebeat监控系统,可参考以下步骤:
编辑/etc/filebeat/filebeat.yml
文件,设置要监控的日志文件路径、输出目标等。例如要监控/var/log
目录下的所有.log
文件并发送到本地Elasticsearch,可参考如下配置:
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
output.elasticsearch:
hosts: ["localhost:9200"]
index: "filebeat-%{[agent.version]}-%{+yyyy.MM.dd}"
启动服务后,通过sudo systemctl status filebeat
检查状态,查看日志文件确保无错误。若安装了Elasticsearch和Kibana,可在浏览器中访问Kibana,配置索引模式来可视化日志数据。