在 Debian 上排查 Filebeat 问题,通常可以按下面步骤系统性地排错。
systemctl status filebeat
如果没启动:
systemctl start filebeat
systemctl enable filebeat
ps aux | grep filebeat
Debian 默认使用 systemd,日志位置:
journalctl -u filebeat -f
或查看旧版本:
tail -f /var/log/filebeat/filebeat
常见错误示例:
配置文件路径:
/etc/filebeat/filebeat.yml
filebeat test config
filebeat test output
例如:
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/nginx/*.log
确认:
ls -l /var/lib/filebeat/registry/
如果 registry 状态异常,可谨慎删除(会重新采集):
systemctl stop filebeat
rm -rf /var/lib/filebeat/registry
systemctl start filebeat
⚠️ 生产环境慎用
systemctl stop filebeat
filebeat -e -d "*" -c /etc/filebeat/filebeat.yml
或只调试部分模块:
filebeat -e -d "publish,input"
sudo usermod -aG adm filebeat
timedatectl
df -h
✅ systemctl status filebeat
✅ journalctl -u filebeat
✅ filebeat test config
✅ filebeat test output
✅ 日志路径存在且可读
✅ 网络连通(ES / Logstash)
如果你愿意,可以把:
filebeat.ymljournalctl -u filebeat 报错信息贴出来,我可以帮你精确定位问题。