使用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 filebeatsudo systemctl enable filebeat。验证与监控
sudo systemctl status filebeat。sudo tail -f /var/log/filebeat/filebeat.log。说明:确保Elasticsearch和Kibana已安装并运行,根据实际需求调整日志路径、索引名称等配置。