0

I have different Grafana dashboards build on Graphite datasources. And add variable with such values:

grp1,grp2,grp3,grp4

Now I can choose any group in dropdown menu and it works perfectly enter image description here

Also I can write in the query body something like: {grp2,grp4} to get sum of this two groups.

My question - how to make variable value that combine several possible values? I mean I want to add to dropdown menu more options like some combinations I tried the same way in Variables menu:

grp1,grp2,grp3,grp4,{grp2,grp4}

but this doesnt works - it create values like {grp2 and grp4} grafana Also I tried to use Alloption here in the menu, but without success.

Mikhail_Sam
  • 10,602
  • 11
  • 66
  • 102

1 Answers1

3

You need to escape comma with \, e.g.:

grp1,grp2,grp3,grp4,{grp2\,grp4}

so {grp2,grp4} will be one item in this case.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • Thank you for your answer! Your solution is just a half way, but now I got the right way :) your approach correctly displays in dropdown menu but show no data. You need to upgrade it this way for correct work: `{grp2\,grp4}`. Edit please and I will accept your answer! – Mikhail_Sam Dec 01 '20 at 12:46
  • @Mikhail_Sam done, but please edit your question with query and used datasource type. Curly bracket syntax is datasource specific, it isn't generic syntax for all datasource types. – Jan Garaj Dec 01 '20 at 13:27
  • Done! ;) Thank you – Mikhail_Sam Dec 01 '20 at 15:47