How to combine two dashboard variables

Hi,

I am currently setting up a Grafana Monitoring for our pfSenses. So far the basics are working fine but I am stuck at the dashboard variable part. I have setup three variables, which I would like to use on my dashboard:

My Infrastructure setup:

srv-a = Grafana + Prometheus
srv-b = pfSense 1 + node_exporter 1
srv-c = pfSense 2 + node_exporter 2

Variable 1

Variable name: host
Variable type: custom
Variable label: Hosts
Variable value: pfSense1_Location : srv-b-IP, pfSense2_Location : srv-c-IP

Variable 2

Variable name: instance
Variable type: query
Variable label: 
Variable hide: variable
Data source: Prometheus
Query: label_values(up{job=~"pfsense.*",instance=~".+"}, instance)
Regex: (.+):\d+

Preview shows the IP addresses from both node_exporters

Variable 3

Variable name: port
Variable type: query
Variable label: 
Variable hide: variable
Data source: Prometheus
Query: label_values(up{job=~"pfsense.*"}, instance)
Regex: /[^:]+:(.*)/

Preview shows the port from both node_exporters

Variable 1 is the label on the dashboard, where people can select the required location from. I would like to get the IP addresses from variable 2 as values into variable 1, instead of entering these manually. Is there any way I could do this?

can you show it graphically?

Hi melrose,

sure can do. Sorry, didn’t think of doing this in the first place.

This is the host variable:

This is the instance variable:

The host variable is suppose to be the label in the dashboard, where people can select the predefined userfriendly pfSense host name or the value All for all hosts at the same time, without having to know the exact IP address. Since I query the required IP addresses from Prometheus with the instance variable, I was wondering whether I can use these in my custom host variable or vice versa.