CentOS7安装ELK实践(二)

安装rpm格式的Filebeat

1、进入rpm包所在的目录,安装:yum install (文件名).rpm

配置文件在vi  /etc/filebeat/filebeat.yml

2、在Filebeat inputs中:

  enable改为true

  paths改为实际log所在的地址,如:- /datas/test/*.log

       

为记录json格式的日志,需添加以下三项

  json.keys_under_root: true
  json.overwrite_keys: true
  json.add_error_key: true

3、在Elasticsearch Output中:

  hosts改为实际es所在地址,如:["127.0.0.1:9200"]

4、重启filebeat服务:systemctl restart filebeat

5、在kibana中,发现已经有了filebeat开头的索引

原文地址:https://www.cnblogs.com/dengshaojun/p/14714157.html