使用Filebeat监控CentOS系统步骤如下:
安装Filebeat
sudo yum install filebeat -y
。配置Filebeat
/etc/filebeat/filebeat.yml
:
filebeat.inputs
中指定路径,如/var/log/*.log
。output.elasticsearch
的hosts
(如localhost:9200
)和index
名称。system
模块监控系统性能(需在filebeat.modules
中配置)。启动服务
sudo systemctl start filebeat
sudo systemctl enable filebeat
。验证与监控
sudo systemctl status filebeat
。sudo tail -f /var/log/filebeat/filebeat.log
。说明:确保Elasticsearch和Kibana已安装并运行,根据实际需求调整日志路径、索引名称等配置。