# How to get host from websocket input plugin in logstash

**URL:** <https://discuss.elastic.co/t/how-to-get-host-from-websocket-input-plugin-in-logstash/143720>\
**Category:** Logstash\
**Created:** [August 9, 2018, 2:29pm UTC](https://discuss.elastic.co/t/how-to-get-host-from-websocket-input-plugin-in-logstash/143720 "2018-08-09T14:29:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreeja](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sreeja](https://discuss.elastic.co/u/sreeja)\
**Post date:** [August 9, 2018, 2:29pm UTC](https://discuss.elastic.co/t/how-to-get-host-from-websocket-input-plugin-in-logstash/143720/1 "2018-08-09T14:29:58Z")

</div>

Could you please let me know is it possible to get the host from websocket input plugin. Right now my output has @timestamp, @version and type. I need to use multiple socket connection and it would be good to have a host in the output file.

I have seen in other cases logstash is adding host along with the event. [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html)

Below is the configuration file I am using. Thanks in advance.

input {  
websocket {  
url =\> "ws://xx:xx:xx:xx:8080/"  
type =\> "string"  
codec =\> "plain"  
}  
}

output {  
file {  
path =\> "/usr/share/logstash/logdata.log"  
}  
}

---

<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 6, 2018, 2:33pm UTC](https://discuss.elastic.co/t/how-to-get-host-from-websocket-input-plugin-in-logstash/143720/2 "2018-09-06T14:33:25Z")

</div>

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