Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct use of variables #40

Closed
pete-leese opened this issue Jul 19, 2018 · 8 comments
Closed

Correct use of variables #40

pete-leese opened this issue Jul 19, 2018 · 8 comments

Comments

@pete-leese
Copy link

Hi.

If I hard code a query for example

region="eu-west-1" it will filter as expected, however if I define a variable;

region="$region" then this does not work.

Can you please advise how this should work ?

@pete-leese
Copy link
Author

looked at query inspector to see what is going on....

hard coded;

url:"api/datasources/proxy/2/api/v1/alerts?silenced=false&inhibited=false&filter=severity%3Dcritical"

using variable

url:"api/datasources/proxy/2/api/v1/alerts?silenced=false&inhibited=false&filter=severity%3D%7Bcritical%7D"

looks like its wrapping the variable value in { } and this is causing the query to fail

@pete-leese
Copy link
Author

further investigation....

I have got variables to work but only when the following options are de-selected in the variable configuration;

Multi-value
Include All option

When either of these options are selected the query fails and wraps the values in { }

@pete-leese
Copy link
Author

Any update on this @cryptobioz

@R4scal
Copy link

R4scal commented Jan 17, 2019

I also have problems with it, multi-value variables not working

@cryptobioz
Copy link
Member

Your issue should be fixed by 54dd297.
To use multi-values variables, you will have to use =~ instead =.

@R4scal
Copy link

R4scal commented Jan 24, 2019

@cryptobioz Can you make release with these fixes?

@cryptobioz
Copy link
Member

@R4scal Version 0.0.7 released, a PR is open (grafana/grafana-plugin-repository#365) to add it to the Grafana plugins' list.

@R4scal
Copy link

R4scal commented Jan 25, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants