基于ELK日志分析系统搭建 v6.0.0 做filebeat配置。
版本:filebeat-6.0.0、logstash-6.0.0、elasticsearch-6.0.0、kibana-6.0.0
修改filebeat.yml 文件
# 启用 enabled: true # 设置日志文件路径 paths: - /data/test2.log #-------------------------- Elasticsearch output ------------------------------ #关闭默认开启的elasticsearch配置 #output.elasticsearch: # Array of hosts to connect to. # hosts: ["localhost:9200"] #----------------------------- Logstash output -------------------------------- #开启logstash配置 output.logstash: # The Logstash hosts hosts: ["192.168.13.245:9022"]
- 创建filebeat、logstash、elasticsearch关联启动文件。
vi first-9an.conf # 指定输入数据源为beats 并且开发9011端口接受数据 input { beats { host => "192.168.13.245" port => 9022 } } # 制定数据输出源为elasticsearch 并且指定index名称 output { elasticsearch { hosts => [ "192.168.13.245:9200" ] index => "first-9an--%{+YYYY.MM.dd}" } }
启动logstash
/usr/local/logstash-6.0.0/bin/logstash -f /ELK/first-9an.conf
启动filebeat
[root@ELK20171129 filebeat-6.0.0-linux-x86_64]# ./filebeat -e -c filebeat.yml
启动kibana
[root@ELK20171129 ELK]# nohup /usr/local/kibana-6.0.0-linux-x86_64/bin/kibana > /ELK/logs/kibana.log 2>&1 &
访问kibana创建索引