创建repo存储库,由于官方源太慢,这里使用国内清华源
cat > /etc/yum.repos.d/elasticsearch.repo << EOF
[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://mirrors.tuna.tsinghua.edu.cn/elasticstack/yum/elastic-7.x/
gpgcheck=0
enabled=1
EOF
#安装filebeat:
yum install -y filebeat
修改配置文件
$ vi /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
output.elasticsearch:
hosts: ["192.168.92.80:9200"]
测试配置是否有误:
filebeat test config -e
启动filebeat服务
systemctl enable --now filebeat
kibana添加index即可查看收集的日志.
内容来源于网络,如有侵权,请联系作者删除!