Closed teodesian closed 1 year ago
Maybe I misunderstand the issue but I am under the impression that this (through Grafana features) should already be possible. I have an example dashboard with this query
with data(time, temperature, city) AS (VALUES
(724125600, 10, 'London'), (724161600, 11, 'London'),
(724161600, 20, 'New York'), (724197600, 21, 'New York'),
(724125600, 25, 'Washington'), (724197600, 26, 'Washington')
) SELECT * from data
WHERE city in (${cities:singlequote})
order by time
And this as a query variable
SELECT * FROM (VALUES ('London'), ('New York'), ('Washington'))
This works as expected, or is there something else you mean?
This works great! Thank you.
I think this should be added to the examples. I'll create a PR along these lines shortly.
Describe the bug Currently to filter via variable with multiple values we need to do some string processing, as the var generally interpolates as:
The most straightforward where clause which should work here would be:
field IN $variable
This would require the variable to be interpolated as:
The way to process things under the status quo requires replace() of the braces and splitting the string via recursive CTE to quote the vars.
To Reproduce Steps to reproduce the behavior:
I've put the entire environment I used to observe the problem up on github: https://github.com/teodesian/memmon
Follow the installation instructions therein.
Versions (please complete the following information):