Output plugin for kafka discovery

(Akash Kumar Dutta) #1

I am fairly new to logstash.

I want to send the logs coming to logstash to a kafka cluster (already running as a k8s service).
I know I need to configure the output plugin inside a configMap. From what I have seen here, it mentions pretty much the env variables that need to be set up. After reading I didn't find exactly how my logstash will be discovering my kafka cluster. I mean it must have something like "kafk-service:kafka-port" for connecting the kafka service to logstash. But I don't see any env variable for that.

Currently, I have my configuration looking as:

input {
  tcp {
    port => 5044
    codec => "json"
output {
  kafka {
    hosts => "kafka-service:9092"
    index => "logstash-%{+YYYY.MM.dd}"
    id => "id=1"

I'm not sure about the hosts env variable. That is the doubt: what is the env variable that connects logstash to kafka cluster.
I will really appreciate any help regarding this (better if I can find a documentation for this) . Thanks.

(Magnus B├Ąck) #2

Use the kafka output's bootstrap_servers option.

(Akash Kumar Dutta) #3

Thank you! :slight_smile:

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.