filebeat6.2.3收集多个日志源 多个topic输出

下载

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

解压

tar -zxvf filebeat-6.2.3-linux-x86_64.tar.gz

配置filebeat.yml

filebeat.prospectors:
- type: log
  enabled: true
  paths:
    - /var/log/mylog/test1.log
  fields:
    log_topics: test1
- type: log
  enabled: true
  paths:
    - /var/log/mylog/test2.log
  fields:
    log_topics: test2
output.kafka:
  enabled: true
  hosts: ["10.112.101.90:9092"]
  topic: '%{[fields][log_topics]}'

运行filebeat

./filebeat -e -c filebeat.yml
原文地址:https://www.cnblogs.com/duanxz/p/2606354.html