安装
1、rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
2、编辑fb.repo文件
[elastic-7.x]
name=Elastic repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1
autorefresh=1type=rpm-md
3、yum安装
yum install filebeat -y
4、设置开机自启
systemctl enable filebeat
配置
查看filebeat支持哪些模块
[root@localhost yum.repos.d]# filebeat modules list
开启支持模块
filebeat modules enable system nginx mysql
修改配置文件/etc/filebeat/filebeat.yml filebeat.inputs:
- type: log
Change to true to enable this input configuration. enabled: true
#Paths that should be crawled and fetched. Glob based paths. paths:
- /var/log/nginx/sc_access.log
#==========------------------------------kafka-----------------------------------
output.kafka:
hosts: ["192.168.229.139:9092","192.168.229.140:9092"]
topic: sc keep_alive: 10s