Filebeat_Nginx

Filebeat_Nginx 收集nginx日志

安装 filebeat 工具

yum install  https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.2.1-x86_64.rpm  -y

  

[root@hh-front-68 ~]# cat /etc/filebeat/filebeat.yml  修改此文件

[root@hh-front-68 filebeat]# cat filebeat.yml
filebeat.prospectors:
- type: log
  enabled: true
  paths:
    - /opt/server/nginx/logs/access.log
  tags: ["nginx_log","sj_access_log"]
- type: log
  enabled: true  
  paths:
    - /opt/server/nginx/logs/error.log
  tags: ["nginx_log","sj_error_log"]
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
setup.template.settings:
  index.number_of_shards: 3
setup.kibana:
output.logstash:
  hosts: ["x.x.x.x:5044"]

 

filebeat 服务守护进程状态

systemctl  start filebeat
systemctl  status  filebeat

  

 

posted @ 2019-06-17 01:00  Boks  阅读(447)  评论(0)    收藏  举报