邓平洲
邓平洲

Reputation: 11

Can filebeat transfer one data to logstash and kafak ?

I want to use filebeat send one log to logstash and kafak,then logstash send the log to es and I can search it in es,kafak use it to analyze data.

filebeat.yml

output.logstash:
  hosts: ["172.31.29.xxx:5044"]
output.kafka:
    enabled: true
    hosts: ["xxx"]
    topic: "test-log"

It's doesn't work,Is there any way to do it?

Upvotes: 0

Views: 151

Answers (1)

leandrojmp
leandrojmp

Reputation: 7473

You can't, filebeat only supports one output.

You have two ways to do what you want.

  1. Send your logs only to Kafka and configure logstash to read from that Kafka topic and then send to elasticsearch.
  2. Send your logs to logstash and have logstash output to both Kafka and elasticsearch.

With the first option, you will get the raw event in Kafka and use logstash to read from it and apply some filters if needed, with the second option you will need to clone each event if you want to apply some filters and still send the raw event to kafka.

Upvotes: 1

Related Questions