filebeat安装配置

filebeat安装配置

 

Filebeat简介:

 

轻量型日志采集器

当您要面对成百上千、甚至成千上万的服务器、虚拟机和容器生成的日志时,请告别 SSH 吧。Filebeat 将为您提供一种轻量型方法,用于转发和汇总日志与文件,让简单的事情不再繁杂。

 

汇总、“tail -f”和搜索

启动 Filebeat 后,打开 Logs UI,直接在 Kibana 中观看对您的文件进行 tail 操作的过程。通过搜索栏按照服务、应用程序、主机、数据中心或者其他条件进行筛选,以跟踪您的全部汇总日志中的异常行为。

 

Filebeat 让简单的事情简单化

Filebeat 内置有多种模块(Apache、Cisco ASA、Microsoft Azure、NGINX、MySQL 等等),可针对常见格式的日志大大简化收集、解析和可视化过程,只需一条命令即可。之所以能实现这一点,是因为它将自动默认路径(因操作系统而异)与 Elasticsearch 采集节点管道的定义和 Kibana 仪表板组合在一起。不仅如此,数个 Filebeat 模块还包括预配置的 Machine Learning 任务。

 

输送至 Elasticsearch 或 Logstash。在 Kibana 中实现可视化。

Filebeat 是 Elastic Stack 的一部分,因此能够与 Logstash、Elasticsearch 和 Kibana 无缝协作。无论您要使用 Logstash 转换或充实日志和文件,还是在 Elasticsearch 中随意处理一些数据分析,亦或在 Kibana 中构建和分享仪表板,Filebeat 都能轻松地将您的数据发送至最关键的地方。

 

 

官网文档:

https://www.elastic.co/guide/en/beats/filebeat/current/index.html

 

 

中文官网地址:

https://www.elastic.co/cn/beats/filebeat

filebeat安装配置

 

 

 

Filebeat安装:

用rpm包安装filebeat软件,可参考

https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-installation.html

 

To download and install Filebeat, use the commands that work with your system.

curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.7.1-x86_64.rpm

sudo rpm -vi filebeat-7.7.1-x86_64.rpm

 

 

 

Filebeat配置:

配置filebeat.yml文件,可参考官网文档:

https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration.html

 

vim /etc/filebeat/filebeat.yml

 

filebeat.inputs:

- type: log

  enabled: true

  paths:

    - /var/log/nginx/access.log      #对应于ngin程序的日志文件

setup.kibana:

  host: "192.168.47.175:5601"       #对应于安装kibana服务的主机,要根据自己的IP修改

output.elasticsearch:

  hosts: ["localhost:9200"]     #对应于安装es服务的主机

  index: "nginx-%{[beat.version]}-%{+yyyy.MM.dd}"

setup.template.name: "nginx"

setup.template.pattern: "nginx-*"

setup.template.enabled: false

setup.template.overwrite: true

 

 

 

Filebeat功能验证:

利用 kibana进行filebeat数据展示

 

filebeat安装配置