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
posted on 2012-07-24 13:41  duanxz  阅读(2172)  评论(0编辑  收藏  举报