user11632040
user11632040

Reputation:

How to make Simple-JSON variable template query in grafana?

I am trying to create a dynamic variable for a graph using a kdb+ database, which requires the Simple-JSON plug in. However, I am struggling to figure out how to write the query in the Query search bar under Variables on my Dashboard.

I have looked into the documentation found here but there is only a few mentions of the templating feature for variables in grafana, but nothing on how to do it.

https://github.com/grafana/simple-json-datasource/blob/master/README.md

Upvotes: 1

Views: 6346

Answers (2)

Philip
Philip

Reputation: 4208

You can write arbitrary text in the timeserie query, it doesn't need to be one of the hardcoded metrics that /search returns.

grafana screenshot


There is also the simpod json datasource plugin.

https://grafana.com/grafana/plugins/simpod-json-datasource

built on top of the Simple JSON Datasource. It has refactored code, additional features and active development.

One of the "additional features" is an "Additional JSON Data" tab where you can use variables. {"key": $variableValue}

Upvotes: 2

user11632040
user11632040

Reputation:

It actually turns out that the adaptor for kdb+/grafana needs it's search function overloaded to be able to accept variables and return a string (or something that grafana can understand).

Upvotes: 0

Related Questions