2017-01-13 20 views
0

metricbeat出力カフカ構成

output.kafka: 
    # Boolean flag to enable or disable the output module. 
    enabled: true 

    # The list of Kafka broker addresses from where to fetch the cluster metadata. 
    # The cluster metadata contain the actual Kafka brokers events are published 
    # to. 
    hosts: ["XX.XXX.XXX.XX:9092","XX.XXX.XXX.XX:9092","XX.XXX.XXX.XX:9092"] 
    # The Kafka topic used for produced events. The setting can be a format string 
    # using any event field. To set the topic from document type use `%{[type]}`. 
    topic: ab-mb-raw, cd-mb-raw 

は内の複数のトピックにデータをプッシュすることは可能ですカフカ?

私は上記の設定を実行したとき、誰もが私の設定が正しいかどうか私を助けることができ、私はカフカのトピック永続

内のデータを見ることができないのですか?

答えて

-1

はい、これを行うことができます。基本的には、あなたの鉱夫の設定で定義する必要があります。例えば

メインfilebeat.yml

output.kafka: 
    hosts: ["kafka:9092"] 
    topic: "%{[type]}" <----- that is what you need. 
    compression: snappy 

# Prospector configs 
filebeat.config_dir: /opt/filebeat/etc/conf.d 

あなたの探鉱/opt/filebeat/etc/conf.d缶からはファイルにこれらのようになります。

filebeat.prospectors: 
    - input_type: log 
paths: 
    - "test.log" 
document_type: "topic_name" <--------- topic per prospector 
+0

metricbeatはfilebeatと同じではありません。 document_typeフィールドはありません! –

関連する問題