filebeat的output类型----------es类型案例

 

编辑05-log-to-es.yml文件:

 

output.elasticsearch:
  hosts: ["http://192.168.8.101:9200","http://192.168.8.102:9200","http://192.168.8.103:9200"]
 
#######执行filebeat
filebeat -e -c ~/config/05-log-to-es.yml
 
登录浏览器:

 

 elk02删除filebeat的数据lib库,进行测试

 [root@elk02 ~]# rm -rf /var/lib/filebeat/*
[root@elk03 ~]# filebeat -e -c ~/config/05-log-to-es.yml
output.elasticsearch:
  hosts: ["http://192.168.8.101:9200","http://192.168.8.102:9200","http://192.168.8.103:9200"]
#######前面的设置起作用了

 

 ####查看索引:

 

 ###创建索引模式

 

 按照下列参数进行配置,配置2个参数

 

 
 
 
 
 创建之后,需要等一段时间才会出现索引

 ########然后去发现

 

 ######需要搜索一会儿,需要时间

 

 需要搜索很长时间,才会出现以下的内容:

 @@@@@@@@@@@@@@@@@@@@

 Installed: filebeat.x86_64 0:7.17.3-1 Complete!

在101机器上面执行以下程序:

 

[root@elk01 filebeat]# filebeat -e -c ~/config/05-log-to-es.yml

总结:elasticsearch,filebeat,kibana三者在101机器上面都要有

 
 
 
 
 
posted @ 2024-01-23 17:04  往事已成昨天  阅读(44)  评论(0编辑  收藏  举报