Regarding grafana multi select variable

Hi ,

I am using a multi-select custom variable ( E.g var_name )

I formatted it as a JSON array using the below syntax:

     ${var_name:json}

Now, my requirement is to extract the individual elements of the array and store it in other variables and use those variables for some other query.

How to do it in Grafana ? Any suggestions ?

Instead of converting the multi-select variable to JSON array and then extracting , is there any way to extract the individual elements of a multi select variable directly and store those in some variables.

Please let me know.

This is a bit urgent for my project requirement.

Any quick response would be welcome.

Thanks,
Nilanjan

you could try the infinity plugin, and use the json inline option, where you specify a payload, and then use your variable as the payload…

Hi ,

I am using infinity plugin with inline JSON and UQL parser .

My query is as below

parse-json data = ‘${var_name:json}’
| project first_element = data[0], second_element = data[1], third_element = data[2], fourth_element = data[3]


But still I am not able to extract any value.

What could be the reason here …

Thanks,
Nilanjan