配置filebeat-6.6.1

1.首先从官网下载

wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.6.1-linux-x86_64.tar.gz

2.解压文件

tar -zxf filebeat-6.6.1-linux-x86_64.tar.gz

3.配置文件shipper.yml,这个是启动的时候指定的文件

filebeat.config.inputs:
  path: config/*.yml
  reload.enabled: false

processors:
  - drop_fields:
      fields: ["input_type", "beat", "offset"]


output.kafka:
    version: 2.0.0
    hosts: ["172.18.2.139:9092","172.18.2.140:9092","172.18.2.141:9092"]
    topic: '%{[type]}'
    partition.round_robin:
      reachable_only: true


logging.level: info
logging.to_files: true
logging.files:
  path: /mnt/logs/filebeat
  name: filebeat
  rotateeverybytes: 10485760  #等于10MB
  keepfiles: 7
  permissions: 0600

 

在/usr/local/filebeat-6.6.1-linux-x86_64/config

配置nginx

[root@nginxae-wan-01 config]# cat nginx.yml
- type: log
  paths:
    - /mnt/logs/nginx/access/*.log
  fields:
    type: nginxaccess
    host: nginxae-wan-01
  fields_under_root: true
  exclude_lines: ['favicon.ico']
  close_inactive: 12h
  ignore_older: 24h
  clean_inactive: 48h

- input_type: log
  paths:
    - /mnt/logs/nginx/error/*.log
  fields:
    type: nginxerror
    host: nginxae-wan-01
  fields_under_root: true
  exclude_lines: ['favicon.ico']
  close_inactive: 12h
  ignore_older: 24h
  clean_inactive: 48h

5.启动程序

cd /usr/local/filebeat-6.6.1-linux-x86_64 && nohup ./filebeat -c shipper.yml >/dev/null 2>&1 &

 

配置收集的log传到kafaka上去,这样kafaka在把数据传输到logstash,传给elsearch。

这样就可以去kibana面板查看了。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值