温馨提示×

centos filebeat怎么看状态

小樊
45
2026-10-05 21:31:23
栏目: 智能运维

在 CentOS 上查看 Filebeat 状态,常用有下面几种方式,按使用场景给你整理一下:


一、使用 systemd(最常见)

如果 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

二、查看 Filebeat 进程

ps -ef | grep filebeat

或

pgrep -a filebeat

三、查看日志(排错很有用)

journalctl -u filebeat -f

或旧版本日志文件:

tail -f /var/log/filebeat/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

六、查看是否成功发送数据(如 Elasticsearch / Logstash)

filebeat test output

或在 ES 中看索引:

curl http://localhost:9200/_cat/indices?v

如果你愿意,可以告诉我:

  • Filebeat 版本(filebeat version)
  • 是发往 ES 还是 Logstash
  • 当前报错信息

我可以帮你更精准地看状态或排错。

0 踩