variables use of text and raw values in field queries #331
Unanswered
francisozic
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Fantastic plugin. I have run into some issues with using variables, and would love to know if this is a bug of user error.
First - when creating variables, I expect to be able to something like use the alias field to specify which is the __text and which is the __value (as in other query variables)
myvar:
e.g. -> $.data[].name ALIAS ... __text
e.g. -> $.data[].id ALIAS ... __text
When I try to do this - or use any ${variable} in a field jsonpath query... it only sort of works
$.data[(@(.name = '$ {myvar}'].something -> Works!
When I try to use the value, it seems to just keep using the name
$.data[(@(.id = $ {myvar}].something -> Fails (uses the string value name, not the id)
Digging further, I am finding similar behavior for all local and global dashboard variables
${__to:date} -> returns bigint time (default)
Interestingly enough, seems to work fine in Params tab:
${__from::date}~${__to:date} Works!
I'm supposing a workaround is to use transforms to at least achieve basic filtering, will try that next.
Grafana 9.2.3
Beta Was this translation helpful? Give feedback.
All reactions