温馨提示×

debian filebeat怎么查运行状态

小樊
41
2026-10-18 03:56:45
栏目: 智能运维

在 Debian 系统上,Filebeat 通常是以 systemd 服务 方式运行的(如果是官方 deb 包安装)。你可以用下面几种方式查看它的运行状态。


一、使用 systemd(最常用)

1. 查看 Filebeat 运行状态

systemctl status filebeat

输出中重点关注:

  • active (running) → 正在运行
  • inactive (dead) → 已停止
  • failed → 启动失败

2. 启动 / 停止 / 重启

sudo systemctl start filebeat
sudo systemctl stop filebeat
sudo systemctl restart filebeat

3. 设置开机自启

sudo systemctl enable filebeat

二、查看 Filebeat 进程

ps aux | grep filebeat

或:

pgrep -a filebeat

三、查看 Filebeat 日志

systemd 日志(推荐)

journalctl -u filebeat -f

查看最近 100 行:

journalctl -u filebeat -n 100

日志文件(取决于配置)

默认可能在:

/var/log/filebeat/filebeat

四、使用 Filebeat 自带命令检查

测试配置文件

sudo filebeat test config

测试输出(如 Elasticsearch / Logstash)

sudo filebeat test output

五、确认是否真的在采集数据

sudo filebeat monitor

(部分版本支持)

或者查看 registry 文件是否更新:

ls -l /var/lib/filebeat/registry

如果你愿意,可以贴一下 systemctl status filebeat 或 journalctl -u filebeat 的输出,我可以帮你具体分析。

0 踩