How to include the host name in the graphite metric name

I want to deploy logstash config on multiple machines and push the metrics to graphite.
So hostname needs to be part of the graphite key

Here is the config I tried.

%{host} is not getting replaced by the ip address or name of the machine on which logstash is running
I tried using %{host} in metrics_format as well as metrics fields. But both are not working.

How can I get the host name in the key?

output {
      graphite {
          host => "graphite.us-east-1.ec2.bloomreach.com"
          port => 2003
          metrics_format => "messi.spark.enhancer.%{host}.logstash.enhlog.*"
          metrics => { "input_pixel_metric" => "%{[input_pixel_metric][count]}" }
      }
}

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