I’m using Grafana 10.4 and I have a dashboard where I have a prometheus datasource variable. I have used regex to filter the sources to only 2, let’s say “Prometheus_Env1” and “Prometheus_Env2”.
I’m trying to use some value dependent on Prometheus_Env1/Prometheus_Env2 in different panels but so far I’ve been unable to do so. So for example, in a panel, I might need “Env1” to filter some metric if user selected “Prometheus_Env1”.
Another specific case where I’m facing difficulties, is that I have an OpenSearch table panel that uses PPL to fetch log information. I have a set of indices named like:
some-index-name-env-1-logs-001
some-index-name-env-1-logs-002
some-index-name-env-1-logs-003
some-index-name-env-2-logs-001
some-index-name-env-2-logs-002
some-index-name-env-2-logs-003
some-index-name-env-2-logs-004
and for now I’m using a PPL query that starts like:
search source=some-index-name--logs-
So that I’m able to fetch all info I need. But what I really want is that if “Prometheus_Env1” is selected, then the query would look like: search source=some-index-name-env-1-logs-*
Any idea how to do that? Since everything comes from a datasource variable, I’m not able to make chaining work, either with datasource var as the first variable or as a link in the chain. I tried applying transformations like filter and renaming to get an equivalent output but can’t make it work either.
Do you have any idea that doesn’t involve creating a separate dashboard? Maybe some conditional hiding and have 2 panels?