# No host field when using Kafka input plugin

**URL:** <https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287>\
**Category:** Logstash\
**Created:** [August 14, 2018, 7:13am UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287 "2018-08-14T07:13:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatemeh\_testing](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@fatemeh\_testing](https://discuss.elastic.co/u/fatemeh_testing)\
**Post date:** [August 14, 2018, 7:13am UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287/1 "2018-08-14T07:13:53Z")

</div>

Hi,  
I'm using the following input  
input {  
udp {  
port =\>   
type =\> "rsyslog"  
}  
kafka {  
bootstrap\_servers =\> "IP-ADDRESS:PORT"  
topics =\> "sth"  
group\_id =\> "sth1"  
}  
}

For UDP inputs, I receive a field named "host" that contains the sender IP address, but this field is not available for the Kafka inputs. I need the senders IP addresses and I want to totally switch from UDP input to Kafka input. How can I take the senders IP address in my new environment?

Regards

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 14, 2018, 5:35pm UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287/2 "2018-08-14T17:35:44Z")

</div>

What does "sender" mean in the case of the kafka input?

---

<div class="post-metadata">

**Author:** ![fatemeh\_testing](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@fatemeh\_testing](https://discuss.elastic.co/u/fatemeh_testing)\
**Post date:** [August 15, 2018, 5:08am UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287/3 "2018-08-15T05:08:44Z")

</div>

Thanks.

For Example I have three machines generating logs and send them to Kafka and then Kafka sends them to Logstash. I need to know the IP address for the machine that generated each individual log. These three machines are senders.

Regards

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 15, 2018, 6:09am UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287/4 "2018-08-15T06:09:02Z")

</div>

I'm pretty sure that information isn't available in the message out of the box, but it seems more recent versions of Kafka support message headers so that producers can add their own hostname as a message header (though I don't know if Logstash's kafka input pays any attention to those headers). If that isn't an option you'll have to add the sender information to the message payload.

---

<div class="post-metadata">

**Author:** ![fatemeh\_testing](https://avatars.discourse-cdn.com/v4/letter/f/eb9ed0/32.png) [@fatemeh\_testing](https://discuss.elastic.co/u/fatemeh_testing)\
**Post date:** [August 15, 2018, 12:08pm UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287/5 "2018-08-15T12:08:26Z")

</div>

Thanks.

Is there any way to add sender information to the message payload using Logstash? I tries to add the host IP address as a tag, but It's not useful in my solution.

Regards

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 15, 2018, 2:35pm UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287/6 "2018-08-15T14:35:04Z")

</div>

Sure, you can add fields to events in Logstash, but where would you obtain the sender information in this case?

---

<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:** [September 12, 2018, 2:35pm UTC](https://discuss.elastic.co/t/no-host-field-when-using-kafka-input-plugin/144287/7 "2018-09-12T14:35:08Z")

</div>

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