JCAguilera
JCAguilera

Reputation: 976

Select value from custom key/value variable in Grafana

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:

I can't make it happened. Please help me with the right sintax or the right way to do this.

Upvotes: 2

Views: 6306

Answers (1)

Vladimir
Vladimir

Reputation: 684

Correct syntax for custom variables is ${variable:text} and ${variable:value}. So in your case ${variable:value} will print IP.

Upvotes: 5

Related Questions