在 Ubuntu 上查看 Filebeat 运行状态,常见有以下几种方式,取决于你是怎么安装的(systemd / 二进制 / 容器)。
systemctl status filebeat
常见状态说明:
active (running) ✅ 正常运行inactive (dead) ❌ 已停止failed ❌ 启动失败systemctl is-enabled filebeat
journalctl -u filebeat -f
或查看日志文件(取决于配置):
/var/log/filebeat/filebeat
ps aux | grep filebeat
或
pgrep -a filebeat
filebeat test config
filebeat test output
cat /var/lib/filebeat/registry/filebeat/data.json | jq
(如果没有 jq:apt install jq)
docker ps | grep filebeat
docker logs -f filebeat
systemctl status filebeat 是 runningfilebeat test config 无报错error / cannot connect如果你愿意,可以把 systemctl status filebeat 或日志报错贴出来,我可以帮你具体看是哪一步有问题。