Hello Grafana experts,
Data is being streamed to our elasticsearch cluster in batches, with each batch having a unique, incrementing ID. I want to show only data from the most recent batch on a dashboard, which will be a wallboard TV in our NOC with auto-refresh enabled. I have created a dashboard variable (set to refresh on time range change) called batch_id
with the below query:
{
"find":"terms",
"field":"batch_id",
"query":"batch_id:*",
"sort":[
{
"batch_id":{
"order":"desc"
}
}
],
"size":1
}
The problem is the batch_id
that gets returned is the oldest, not the newest (based on the time range of the dashboard). It’s like the sort
part of the query is being stripped out before being sent to elasticsearch.
Is this a known issue and/or is there another way to achieve this? Using the sort option within the variable sadly doesn’t help as Grafana doesn’t automatically select the topmost option when auto-refreshing.
Many thanks for any advice