user2051904
user2051904

Reputation: 73

Logstash not forwarding logs to ES via Kafka

I'm using ELK 5.0.1 and Kafka 0.10.1.0 . I'm not sure why my logs aren't forwarding I installed Kafkacat and was successfully able to Produce and Consume logs from all the 3 servers where Kafka cluster is installed.

shipper.conf

input {
    file {
            start_position => "beginning"
            path => "/var/log/logstash/logstash-plain.log"
            }
}

 output {
 kafka {
    topic_id => "stash"
    bootstrap_servers  => "<i.p1>:9092,<i.p2>:9092,<i.p3>:9092"
  }
}

receiver.conf

input {
kafka {
        topics => ["stash"]
        group_id => "stashlogs"
        bootstrap_servers  => "<i.p1>:2181,<i,p2>:2181,<i.p3>:2181"

}
}

 output {
    elasticsearch {
       hosts => ["<eip>:9200","<eip>:9200","<eip>:9200"]
       manage_template => false
       index => "logstash-%{+YYYY.MM.dd}"
  }
 }

Logs: Getting the below warnings in logstash-plain.log

[2017-04-17T16:34:28,238][WARN ][org.apache.kafka.common.protocol.Errors] Unexpected error 
code: 38.
[2017-04-17T16:34:28,238][WARN ][org.apache.kafka.clients.NetworkClient] Error while fetching 
metadata with correlation id 44 : {stash=UNKNOWN}

Upvotes: 0

Views: 516

Answers (1)

dawsaw
dawsaw

Reputation: 2313

It looks like your bootstrap servers are using zookeeper ports. Try using Kafka ports (default 9092)

Upvotes: 2

Related Questions