victorialogs-datasource icon indicating copy to clipboard operation
victorialogs-datasource copied to clipboard

passing query through grafana variable doesn't work anymore

Open jenneron opened this issue 5 months ago • 1 comments

Our use case is to restrict table with some label, but also provide an option to append another query or search field from user input.

For example, we can match _AUDIT_LOGINUID:* *

screenshot

image

But we can't set $query to * and match _AUDIT_LOGINUID:* $query:

screenshot

image

I believe this is due to escape characters in resulting expression: expr:"_AUDIT_LOGINUID:* \"*\""

While this might be sufficient to provide a search field, it makes a wrong expression when the variable is empty: expr:"_AUDIT_LOGINUID:* \"\""

It works when downgrading the plugin to 0.3.0:

screenshot

image

The resulting query with 0.3.0: expr:"_AUDIT_LOGINUID:* *"

The resulting query with 0.3.0 and empty variable: expr:"_AUDIT_LOGINUID:* "

jenneron avatar Sep 18 '24 08:09 jenneron