I have queries aliased as:

"Temperature $Names1" and "Power $Names1"

I would like my legend to read:

"Temperature <name>" and "Power <name>"

My legend works as expected, but I am trying to set an alias so I can plot the Power data on y-axis2 and set the color.

Under visualization in "alias or regex" I have typed:

/^Power $Names1$/

It seems though that the $ for my variable is terminating the regex. I have tried various methods of escaping it but without success.

Maybe I am doing something obviously wrong?

1 Answers

Emma On

This link helps you to write a correct expression for Grafana.

Example in Grafana

Formats multi-value variable into a regex string.

servers = ['test1.', 'test2']
String to interpolate: '${servers:regex}'
Interpolation result: '(test1\.|test2)'

Based on that, you might want to modify your variables that you are trying to pass.