We have several logstash hosts that have the same config, and we like to add a field upon ingestion via the input to help us show which logstash host ingested each line. It helps us to do some graphing, mapping, and checking.
Right now, we have to hard set this as a field within the input (a la add_field => { "logstash_host" => "logstash2" }
Is there a way to do this with some sort of macro so that we can use the same input file across all of our logstash nodes? Would be nice if we could do something like "%{IP}" or "%{LAST_OCTET}" or something like that.
Alternatively, if you're using a tool like Ansible, Chef, or Puppet to push your configuration (which you should) you can easily make a template out of the configuration file and have the tool in question insert the hostname.
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.