- FileBeat是一个agent,输出到es、logstash
- 配置输入,可以有多个输入
/var/log/*.log - 工作原理
- libbeat 平台
安装filebeat
- 直接在官网下载tar.gz安装(后续上容器)
配置filebeat
filebeat.reference.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
复制代码
-
/var/log/*/*.log从/var/log子文件夹中获取所有.log, 现在还支持获取所有层中的所有文件 - 输出要么ES 要么Logstash进行额外的处理
- ES
output.elasticsearch: hosts: ["myEShost:9200"] 复制代码
- Logstash
- 还可以使用filebeat提供的Kibana示例仪表盘
setup.kibana: host: "mykibanahost:5601" 复制代码
- 如果ES和kibana设置了安全性 (这里密码应该配置是加密的),如果没有为Kibana指定凭据,那用ES的凭据
output.elasticsearch: hosts: ["myEShost:9200"] username: "filebeat_internal" password: "YOUR_PASSWORD" setup.kibana: host: "mykibanahost:5601" username: "my_kibana_user" password: "YOUR_PASSWORD" 复制代码
配置filebeat到logstash
- 配置Logstash接受filebeat传来的消息
#这是filebeat.yml 输出到5044端口 默认的logstash端口 #----------------------------- Logstash output -------------------------------- output.logstash: hosts: ["127.0.0.1:5044"] 复制代码
- For this configuration, you must load the index template into Elasticsearch manually because the options for auto loading the template are only available for the Elasticsearch output. ??索引模板是什么?
加载索引模板
- 在Elasticsearch中,索引模板用于定义确定如何分析字段的设置和映射。
- Filebeat包安装了推荐的Filebeat索引模板文件。
#==================== Elasticsearch template setting ========================== #默认一个分片 这就是原因 setup.template.settings: index.number_of_shards: 1 #index.codec: best_compression #_source.enabled: false 复制代码
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。