Add support for dashboard/panel variables in json/jq processor #1334
Replies: 4 comments
-
|
It is already possible. You don't need to pass grafana variables as jq variables. Instead, just use grafana variables syntax in your jq/JSONata query and that will get interpolated automatically |
Beta Was this translation helpful? Give feedback.
-
|
Create a new dashboard, use the table visualization Query type = json, parser = jq, source = url, format = table, method = get, URL = something that returns json, payload is irrelevant at this time Query type = UQL, source = url, format = table, method = get, url same as above The UQL words as you describe, the json/jq does not. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @yesoreyeram ! I have same problem, jq cannot recognise vars, could you put an example please how to use it 🙏 |
Beta Was this translation helpful? Give feedback.
-
|
Hi @yesoreyeram , this seems to not be working as the string is parsed to JQ before it's interpolated on the backend, so we are getting the error that there is unexpected token |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Our use case has a repeating panel using the traffic light panel and we'd like to pass the variable into the json/jq parser so we can enable the legend and have the name of the application being monitored displayed in the panel. The gojq library support variables here.
Additionally, it would be useful if the http response code was available to the json/jq parser. We are utilizing the new feature to ignore the response code and it's working great when the spring apps are returning a 503. But there are a few conditions where we need to handle a 404, 500, etc. We could wrap the jq parser with an if/else/end to account for the response code if it was available.
Beta Was this translation helpful? Give feedback.
All reactions