# Logstash Kafka-Input plugin not using the values supplied in \`bootstrap\_servers\` for connecting to Kafka Broker

**URL:** https://discuss.elastic.co/t/logstash-kafka-input-plugin-not-using-the-values-supplied-in-bootstrap-servers-for-connecting-to-kafka-broker/193358
**Category:** Logstash
**Created:** [August 1, 2019, 3:14pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-plugin-not-using-the-values-supplied-in-bootstrap-servers-for-connecting-to-kafka-broker/193358 "2019-08-01T15:14:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![thomjs](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@thomjs](https://discuss.elastic.co/u/thomjs)
#### Post date: [August 1, 2019, 3:14pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-plugin-not-using-the-values-supplied-in-bootstrap-servers-for-connecting-to-kafka-broker/193358/1 "2019-08-01T15:14:08Z")

</div>

Elastic Stack Version: 7.2.0  
Kafka Version: 5.0.1  
Using docker-compose to deploy Elastic Stack, with Kafka sitting on a remote system which is reachable via direct IP (192.168.0.2)

In the logstash.conf file we have:

```auto
input {
        kafka {
            bootstrap_servers => ["192.168.0.2:9092"]
            topics => ["syslog"]
            tags => ["from-kafka"]
        }   
}
...

```

I have confirmed using `kafka-console-consumer` that the endpoint is active and that the topic exists. However, when the logstash server is started the log entries show that logstash is trying to connect to localhost:

```auto
[2019-08-01T15:03:49,021][WARN][org.apache.kafka.clients.NetworkClient] [Consumer clientId=logstash-0, groupId=logstash] Connection to node 1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.

```

I have tried every other possible configuration of kafka input such as:

```auto
        kafka {
            bootstrap_servers => "192.168.0.2:9092"
            topics => ["syslog"]
            tags => ["from-kafka"]
        }   

```

As shown in documentation, but the same error as above is shown. And:

```auto
        kafka {
            host => "192.168.0.2"
            port => "9092"
            topics => ["syslog"]
            tags => ["from-kafka"]
        }   

```

But logstash errors out saying that `host` and `port` are unknown fields for `kafka-input`.

I am at a point where I do not believe that this can be a misconfiguration, as the config file is exactly as is described in the 7.2 documentation for `kafka-input` plugin.

Is there a new change in the `kafka-input` plugin that hasn't been properly documented in 7.2.0 documentation or is there an unknown bug in this new version? I haven't had a chance to downgrade to an older stack version but I will try asap to see if this is a versioning issue. Has anyone had any success getting a remote kafka-input setup working with ES 7.2.0 yet? I can get it working with `localhost:9209` but we are in desperate need of having a decoupled Kafka-ES setup.

Thanks.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [August 1, 2019, 3:51pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-plugin-not-using-the-values-supplied-in-bootstrap-servers-for-connecting-to-kafka-broker/193358/2 "2019-08-01T15:51:39Z")

</div>

If I am reading it correctly then the bootstrap server has told the kafka client to connect to localhost/9092.

---

<div class="post-metadata">

### Author: ![thomjs](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@thomjs](https://discuss.elastic.co/u/thomjs)
#### Post date: [August 1, 2019, 4:06pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-plugin-not-using-the-values-supplied-in-bootstrap-servers-for-connecting-to-kafka-broker/193358/3 "2019-08-01T16:06:12Z")

</div>

Oh okay, so this is an issue with the Kafka bootstrap client telling the `logstash` server to try to connect to the wrong endpoint? I will look into it a bit further, thanks.

EDIT:  
Thanks @Badger, this was in fact the issue. I resolved it by changing the `advertised.listeners` in `config/server.properties` in Kafka. It is a Kafka issue. My bad. Thanks!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 29, 2019, 4:06pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-plugin-not-using-the-values-supplied-in-bootstrap-servers-for-connecting-to-kafka-broker/193358/4 "2019-08-29T16:06:16Z")

</div>

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