2020年4月

简述:从log 日志中读取,然后设置不同的type,传输到kafka

Filebeat.yml

filebeat.config.inputs:
  enabled: true
  path: configs/*.yml  #input配置文件的路径
output.kafka:
  hosts: ["xxx.xx.xx.xx:9100"]
  topic: '%{[fields.type]}'  #根据设置的不同的fields.type 输出到不同的kafka的topic。

input.yml

- type: log           #指定输入类型
  backoff: "1s"                #到底之后 多久在检测
  #多行过滤
  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
  multiline.negate: true
  multiline.match: after
  paths:           #日志路径
    - /home/logs/systemlog/access/*
  fields:       #给日志设置type
    type: systemlog_access

多行过滤文档

filebeat可以配置processors,来统一对多种日志进行过滤或增强 processor文档

Filebeat可以将运行状况发送到ES监控集群,然后在kibana上监控 文档