I have dashboard where data comes from InfluxDB and graphite. For both I have variable to choose the input VM.
I would like to use one variable for both. Datasources provide different metrics, but they are related, same site.
InfluxDB site names are like this: SITE1, SITE2, SITE3
grphite sites are: site1, ste2, site33
Meaning they are similar, but not the same and I can’t match them in queries or filter with regex.
I tried creating custom variable.
So the idea would be that the custom one is the main, that the user sees. Based on the selection it would select corresponding influxDB and graphite site variable and display metrics.
Hope I was clear.
It looks like a task for case insensitive InfluxDB regexp. E.g. you will use graphite value in InfluxDB regexp:
WHERE "tag" =~ /(?i)^$sitevariable$/
Thanks, but the case sensitivity is not the case always. Like when the InfluxDB variable is “THIS-IS-SITE1” and corresponding graphite site is “tis1” What is the idea then?
i thought that, if I have third custom variable, with values SITE1-tis1. How can I use this in regex? So it would check only part of the value. Currently it checks all and does not match.
Trying to sum up. There are 2 list of variables(datasources)
My idea was that I will create custom variable, where the value is combined from both, like this:
User would select from that list. And based on the selection grafana would match influx and graphite variables.
Is is possible? How I should do it?
How is filtering done if I influx query value is SITE1-OS and corresponding value in the custom one is SITE1-OS|ste1. It currently compares the whole string, but can I get it to check part of the string?
Then create measurement, where you define custom relations and use it as it is described in:
Create new “structure” measurement with records with tags (timestamp of the records is not important):
Create 1st dashboard variable text from text tag values (SHOW TAG VALUES WITH KEY = "text").
Create 2nd hidden dashboard variable value with query SHOW TAG VALUES WITH KEY = "value" WHERE "text"=$text.
=> Grafana will select in the background correct value for your InfluxDB querier - you have to use $value …