Aggregate Nginx Metrics


Today I use StatsD to generate metrics about Nginx access, for example:

  • how many requests in especific URL;
  • how many 5XX/4XX/3XX/2XX httpcode for especific application

but I have a problem with application URL when the parameter used is in URL before "?".

For example:

and I have to transform this URLs in this in Logstash before send to StatsD to Aggregate correctlly:

the problem is how every request the parameters are diferent, the StatsD not aggregate and I have to change the URL before send to StastD.

There is a better way to do this? Maybe not using StatsD?

I saw the metric filter plugin in Logstash but I will to make the same substituition in the URLs :sob:

You can use a grok filter to extract pieces of a string (the parts inbetween the variable parts) and put them back together with placeholders instead of the actual values. You might also be able to use a mutate filter and its gsub option.