Create metrics with dynamic names


(Daniel Scott) #1

Is it possible to create metrics with a dynamic name, and output all of them, without having to list the possible values individually?

For example, we have request logs from apache coming into logstash, and we would like to send the count of each response code to graphite.

filter {
  metrics {
    meter => [ "http_%{response}" ]
    add_tag => "metric"
  }
}

output {
  
  if "metric" in [tags] {
    stdout {
      codec => line {
        format => "rate: %{[######][rate_1m]}"
      }
    }
  }
}

What do I put in ###### to output every possible value of %{response}, e.g. 200, 401, 500, etc?


Outputting Metrics while respecting Dynamic Naming Conventions
(system) #2

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