I've got a pipeline: JSON formatted log file -> Filebeat -> Logstash -> ES. I'd like to add the Logstash host name to the document before they are sent along to ES. I took a stab at it:
You can use a json filter to parse that JSON string, but if that's not the hostname you're interested in perhaps it doesn't matter.
I glanced at the logstash hostname link, and that makes sense, my only concern is does it make that socket call for every event is processed?
Yes, but I'd expect it to be a cheap operation. Otherwise you should be able to fetch the hostname once when the filter initializes and reuse that value for each event. Something like this might work:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.