Elastic stack(基于7.0.0)

栏目: 后端 · 发布时间: 6年前

Elastic stack(基于7.0.0)
  • 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
复制代码

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

R Cookbook

R Cookbook

Paul Teetor / O'Reilly Media / 2011-3-22 / USD 39.99

With more than 200 practical recipes, this book helps you perform data analysis with R quickly and efficiently. The R language provides everything you need to do statistical work, but its structure ca......一起来看看 《R Cookbook》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具