Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid escaping custom Grafana variable?

My Grafana dashboard shows statistics for some Elastic documents. Some of these documents have the attribute important_details, some don't. I want to create a "Has important details: Yes/No/All" filter.

What I did was I created a new has_important_details variable, type "Custom", with the following options:

Yes : _exists_:important_details, No : NOT _exists_:important_details

Then, I'm editing the panel and add $has_important_details to the Query field.

This doesn't work, and the reason seems to be that instead of _exists_:important_details, it actually sends the query

_exists_\\:important_details

and likewise

NOT\\ _exists_\\:important_details

for the opposite.

like image 278
Antonis Christofides Avatar asked Mar 01 '26 07:03

Antonis Christofides


1 Answers

I found it out myself after all. Instead of $has_important_details, the Query field should be ${has_important_details:raw}.

like image 196
Antonis Christofides Avatar answered Mar 03 '26 11:03

Antonis Christofides



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!