Skip to content

passing query through grafana variable doesn't work anymore #77

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

Closed
jenneron opened this issue Sep 18, 2024 · 3 comments
Closed

passing query through grafana variable doesn't work anymore #77

jenneron opened this issue Sep 18, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jenneron
Copy link

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:* "

@Loori-R Loori-R self-assigned this Sep 18, 2024
@Loori-R Loori-R added the bug Something isn't working label Sep 18, 2024
@skoppe
Copy link

skoppe commented Sep 27, 2024

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.

Same here. Couldn't get it to work, good its a known issue.

BTW, victorialogs and this datasource are amazing.

@hagen1778
Copy link
Contributor

Variables are correctly substituted starting from v0.6.0. Closing this issue as done. Feel free to re-open if problem still exists.

@hagen1778
Copy link
Contributor

@Loori-R @dima-vm please do the follow-ups on related tickets when making a release similarly to how we recommend it here https://docs.victoriametrics.com/contributing:

waiting for release label is assigned to issues that required code changes and those changes were merged to upstream, but not released yet. Once a release is made, maintainers go through all labeled issues, leave a comment about the new release, remove the label, and close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants