在 CentOS 上查看 Filebeat 状态,常用有下面几种方式,按使用场景给你整理一下:
如果 Filebeat 是通过 yum / rpm 安装的,一般用 systemd 管理:
systemctl status filebeat
常见状态说明:
active (running):正在运行 ✅inactive (dead):已停止 ❌failed:启动失败 ⚠️开机启动状态:
systemctl is-enabled filebeat
启动 / 停止 / 重启:
systemctl start filebeat
systemctl stop filebeat
systemctl restart filebeat
ps -ef | grep filebeat
或
pgrep -a filebeat
journalctl -u filebeat -f
或旧版本日志文件:
tail -f /var/log/filebeat/filebeat
Filebeat 提供了监控接口(默认在 localhost:5066):
curl http://localhost:5066/stats
如果你开启了监控:
curl http://localhost:5066/state
如果连不上,检查
filebeat.yml里是否开启了:
http.enabled: true
http.host: localhost
http.port: 5066
filebeat test config
测试输出是否正常:
filebeat test output
filebeat test output
或在 ES 中看索引:
curl http://localhost:9200/_cat/indices?v
如果你愿意,可以告诉我:
filebeat version)我可以帮你更精准地看状态或排错。