filebeat-6.4.3-windows-x86_64输出Kafka

配置filebeat.yml文件

filebeat.prospectors:

- type: log
  encoding: utf-8
  enabled: true
  paths:
    - e:\log.log
  multiline:
    pattern: '^\['
    negate: true
    match: after
  fields:
  log_topics: test1

    
#============================= Filebeat modules ===============================

filebeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: false

  # Period on which files under path should be checked for changes
  #reload.period: 10s

#==================== Elasticsearch template setting ==========================

#setup.template.settings:
#  index.number_of_shards: 3
  #index.codec: best_compression
  #_source.enabled: false


#setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  #host: "localhost:5601"


#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output ------------------------------

output.kafka: 
    enabled: true 
    hosts: ["127.0.0.1:9092"]
    topic: test1
    max_message_bytes: 10485760 

启动

.\filebeat -e -c filebeat.yml 就可以启动filebeat

猜你喜欢

转载自www.cnblogs.com/zhanchaohan/p/10281164.html