title: logstash graphite output use variable metric name
body: <p>I am using logstash (1.4.2 on centos) with metrics filter and graphite output to graph access log HTTP response codes.</p>
  
  <p>The basic configuration works. Here is my working config file.</p>
  
  <pre><code>input {
    file {
       path =&gt; "/var/log/nginx/access.log"
    }
  }
  filter {
    grok {
      match =&gt; { "message" =&gt; "%{COMBINEDAPACHELOG}" }
    }
    date {
      match =&gt; [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
    }
    metrics {
      meter =&gt; [ "http.%{response}" ]
      add_tag =&gt; "metrics" 
    }
  }
  output {
    if "metrics" in [tags] {
      graphite {
        host =&gt; "localhost"
        port =&gt; "2003"
        metrics =&gt; [ "mymetric.http.200", "%{http.200.rate_1m}"]
      }
    }
  }
  </code></pre>
  
  <p>And the output is shown correctly e.g.</p>
  
  <pre><code>mymetric.http.200 0.8430647815095349 1413557739
  </code></pre>
  
  <p>However I want to install the <strong>same</strong> config file on multiple servers (hosts) and include the host name in the metric name.</p>
  
  <p>I tried to use the %{host} variable in the metrics definition e.g.</p>
  
  <pre><code>metrics =&gt; [ "mymetric.%{host}.http.200", "%{http.200.rate_1m}" ]
  </code></pre>
  
  <p>But this does not send anything to graphite and I get</p>
  
  <pre><code> "Message is empty..." 
  </code></pre>
  
  <p>in the logstash debug output. Any ideas?</p>