I want to have multiple logstash reading from a single kafka topic. The log message in a kafka topic should be read by only one of the logstash instances. I could not find any doc related to this.
I have some doubts regarding this deployment:-
Let say we have a kafka topic named logstash_logs
with three partitions.
Doubt 1
If the partitions are placed in a same kafka broker machine for now. Is the below logstash input config correct for all the logstash instances:-
input {
kafka {
zk_connect => "kafka:2181"
group_id => "logstash"
topic_id => "logstash_logs"
reset_beginning => false
consumer_threads => 1
}
}
Doubt 2
What is the correct no. of consumer_threads to add? If I have 3 logstash instances reading from the kafka topic. Then is consumer_threads => 1
in each logstash input config good number or I should add consumer_threads => 3
in each machine. (3 is the no. of partitions in the topic). What if I have only two logstash instances reading from the kafka topic?