Kafka/zookeeper not running in the same machine as the logstash. It is running in a different macine. Also I am able to telnet to kafka on port 2181 and also I am able to connect to kafka from the kafka web console. So, I don't think there is any network connectivity issue between both the machines.