Is it possible to create a shared variable that works across multiple dashboards in Grafana?
I have a main “map” dashboard that links out to several other dashboards, and I want them all to share the same variable selection. Or is it a case of having to manually copy and paste the variable configuration into each individual dashboard?
Any advice on the best way to handle this would be highly appreciated!
Grafana does not have true global or shared variables. We can solve this issue by
using url parameter passing between dashboards
1 → Add the same variable to all dashboards
In every dashboard go to
Settings → Variables → Add variable
Fill in exactly the same values in each dashboard
To get your dashboard uid → open the target dashboard and copy from the url
3 ->Use variable in your panel queries
In every dashboard panel query use
sql → SELECT “value” FROM “cpu_load”
WHERE “host” =~ /^$host$/
AND $timeFilter
now we can select from dropdown and when you select a host on your main map dashboard and click the link, the target dashboard opens with the same host automatically selected no manual copying needed.