2

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:

  • Use the "Repeat by variable option" in the panel where I want to display the IP in, and select the variable "name".
  • Tried to access the value using this sintax: ${list[name]} and ${list.${name}}
  • Using this sintax ${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.

1
  • It is not clear how you have defined that variable and what kind of syntax is expected after variable interpolation. Commented Oct 21, 2021 at 17:01

1 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.