Reputation: 976
I want dome devices connected to a Grafana dashboard. Each device has a name. I wanted to "attatch" an IP to each device, but I can't modify the database, so I figured I could use custom variables.
The name of the device is saved on the "name" variable and I used a key/value custom variable called "list" with the name of the device as the key, and the IP as the value, like this:
DEVICE 1 : 192.168.0.26, DEVICE 2 : 192.168.0.27
Now I want to display the correct IP when the user select the name of the device but I haven't figured out the right way to do it.
I've tried the following:
${list[name]}
and ${list.${name}}
${list.name}
seems to work, but it only displays the first value.I can't make it happened. Please help me with the right sintax or the right way to do this.
Upvotes: 2
Views: 6306
Reputation: 684
Correct syntax for custom variables is ${variable:text}
and ${variable:value}
. So in your case ${variable:value}
will print IP.
Upvotes: 5