I am trying to pass the hostname of the indexer to Influx so I can use it as a tag to measure index rates collectively and individually. I am unable to set the hostname using send_as_tags like I would expect. It seems like the host thats passed is the target relay that the output plugin is sending to rather then the source indexer actually sending the metric.
For all general issues, please provide the following details for fast resolution:
Version: 6.0.2
Operating System: CentOS
Config File (if you have sensitive info, please remove it):
I am trying to pass the hostname of the indexer to Influx so I can use it as a tag to measure index rates collectively and individually. I am unable to set the hostname using send_as_tags like I would expect. It seems like the host thats passed is the target relay that the output plugin is sending to rather then the source indexer actually sending the metric.
For all general issues, please provide the following details for fast resolution:
filter {
ruby { init => "require 'socket'" code => "event.set('indexer_hostname', Socket.gethostname)" }
if [type] == "generated" { metrics { meter => "events" add_tag => "metric" flush_interval => 60 } } }
output { if "metric" in [tags] { file { path => "/var/log/logstash/metrics.log" codec => line { format => "1m rate: %{[events][rate_1m]} ( %{[events][count]} )" } }
}
}
Run w/ Logstash and view metrics in influx and see the hostname is the target rather then the source