Grafana + Elastic escaping characters - Breaking query

Hello,

So i wanted to use templating with variables, and i am in a need to change part of elastic query, but it seems that Grafana escapes " : and space characters and ads addional \ to query and that spolis that query.

in more details:

I created new custom variable named validation
added value : AND NOT exception:“javax.validation.ConstraintViolationException”

and used it in query like that:

level:“ERROR” [[validation]]

so in the end it should look like that:
AND level:“ERROR” AND NOT exception:“javax.validation.ConstraintViolationException”

but elastic gets
level:“ERROR”\ AND\ NOT\ exception:“javax.validation.ConstraintViolationException”

PS! This i simplified example, and there are some more complicated stuff going on, and variable should be in multible places. :).

Any ideas how to avoid such escaping?

Also i would realy like to add alias / keyword for that variable, so that it would be “nice” in dropdown. :D.

Try advanced variable formatting and use raw value to avoid escaping:

${validation:raw}
1 Like

great! i have been in the trouble for a long time