ELK6.5 Nginx 日志搜集-05 filebeat 安装

node1:elasticsearch、kibana、logstash

node2:filebeat


1、如前文,下载 filebeat 6.5.0 版 在 node2 节点安装

filebeat 的安装,运行,是不需要 jdk 环境的

# rpm -ivh filebeat-6.5.0-x86_64.rpm

进入配置文件目录,修改配置文件

# cd /etc/filebeat/
# vim filebeat.yml    (yml 文件,对格式要求比较严谨)
[root@node2 filebeat]# cat filebeat.yml |egrep -v "*#|^$"
filebeat.inputs:
- type: log
  enabled: false
  paths:
    - /var/log/*.log
processors:
- drop_fields:
   fields: ["input", "offset", "prospector"]
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
name: node2
output.logstash:
  hosts: ["192.168.1.113:5044"]

我搜集的是 nginx 日志,所以,直接使用模板了。

# cd /etc/filebeat/modules.d/
# mv nginx.yml.disabled nginx.yml
[root@node2 modules.d]# vim nginx.yml
- module: nginx
  # Access logs
  access:
    enabled: true
    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:
    var.paths: [/var/log/nginx/access.log]
  # Error logs
  error:
    enabled: true
    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:
    var.paths: [/var/log/nginx/error.log]

启动 filebeat

# /etc/init.d/filebeat start

图片.png


写的不好、欢迎指正:VX:85862870


猜你喜欢

转载自blog.51cto.com/11118703/2327439