Beats:轻量级的日志采集器
成员:
使用Beats采集日志
(1)使用浏览器下载安装包
(2)[root@elk-3 ~]# rpm -ivh filebeat-7.11.1-x86_64.rpm
2.编辑配置文件
[root@elk-3 ~]# vi /etc/filebeat/filebeat.yml
注释掉# enabled: false
因为我们需要输入到es而不是控制台
paths:
- /var/log/elasticsearch/elk.log使用es的日志
查看es的日志
output.elasticsearch:
# Array of hosts to connect to.
hosts: [“192.168.200.39:9200”]输出绑定到elk-1上
启动filebeat
[root@elk-3 ~]# systemctl start filebeat
查看进程
[root@elk-3 ~]# ps aux |grep file
dbus 876 0.0 0.1 100480 1160 ? Ssl Feb22 0:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
elastic+ 2642 0.7 36.5 3253168 365956 ? Ssl Feb22 2:58 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/elasticsearch -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet
root 3085 1.2 5.0 983388 50656 ? Ssl 00:23 0:00 /usr/share/filebeat/bin/filebeat --environment systemd -c /etc/filebeat/filebeat.yml --path.home /usr/share/filebeat --path.config /etc/filebeat --path.data /var/lib/filebeat --path.logs /var/log/filebeat
root 3094 0.0 0.0 112644 952 pts/1 S+ 00:23 0:00 grep --color=auto file
到elk-1查看是否产生
然后到Kibana建立filebeat的索引
出现错误:不出现filebeat的日志
解决方法:因为之前安装了filebeat7所以报错