Converting Nginx access log or InfluxDB tag data to lowercase

689 Views Asked by At

In Grafana I'm building a list of hostnames for templating. That data is stored in InfluxDB, supplied by Telegraf, using the logparser plugin to eat some Nginx access logs. Nginx is storing the hostname in whatever case the request comes across in:

HOSTNAME.COM
HOSTNAME.com
hostname.com

When I fetch those values from influxdb:

show tag values with key = "hostname" where host =~ /^$host$/

There does not appear to be an advertised way to convert these values to lowercase, or group them as show queries don't support a grouping function.

I also looked into having Nginx write this information to the access log in lowercase but was unable to figure that out also.

How can I group these values together at any point between the Nginx request and the InfluxDB query?

0

There are 0 best solutions below