Closed lpnc closed 1 year ago
According to my experiments, you can directly use ${xxx}
to denote the variable value. For example, if there is a variable called uid
and is a number, the aggregate code should be:
{
"$match": {
"createdAt": {
"$gte": {
"$date": "${__from:date}"
},
"$lte": {
"$date": "${__to:date}"
}
},
"uid": ${uid:int}
}
}
Ignore the error in the json, when the plugin query to the backend, it will automatically replace ${uid:int} with number
This plugin supports the standard grafana syntax for variables, and will automatically handle inserting them into the JSON, as the above post describes. If you have a specific query that is not replacing variables, please post it here along with versions of grafana and the plugin, and I will try to reproduce. Otherwise, I will close this as not an issue in a few days if I don't hear back.
Simply a very powerful feature not suported yet... ...Or is it just me doing something wrong?