Bug? Cannot use template var as Influx field key

Hi there,

I have a DB in Influx, with a measurement (table) of “stats”. The stats are regular fields. I created a template var (now just called variable) “metric” in Grafana by making a query: show field keys and then a RegEx to only match keys stats/.*.

When building a graph using the standard picker, when I SELECT the field to graph and select $metric, it displays: field(/^$metric$/) but doesn’t work. If I switch to ‘edit’ mode, it shows:

SELECT mean("/^$metric$/") FROM /^$poller$/ WHERE ("ROUTER_NAME" =~ /^$router$/) AND $timeFilter GROUP BY time($__interval) fill(null)

To fix, I need to manually change to: SELECT mean("$metric") ....

I’m using the latest Grafana (5.0.4) and latest Influx (1.5.2).


  • Aaron