How to get host from websocket input plugin in logstash

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

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"
}
}

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