Grafana table to show duplicate entries from elasticsearch index

I’m trying to work out how to show a table of elasticsearch duplicate entries on a string field hash.sha512

I’m currently using Grafana 5.4 is the above possible or will I need to switch to the 6.0 beta?

Any help would be greatly appreciated.

Jimbo

On the command line with Curl, I do something like this. Which is returning a list of the sha512 entries which are duplicates along with a count of the number of duplicates of each. I can’t seem to work out how I can achieve a similar list in Grafana.

curl --silent -XPOST ‘http://localhost:9200/elastic_index/_search?pretty’ -H’Content-Type: application/json’ -d’
{
“size”: 0,
“aggs”: {
“perFileAggregation”: {
“terms”: {
“field”: “hash.sha512.keyword”,
“min_doc_count”: 2
}
},
“duplicateCount”:{
“cardinality”: {
“field”: “hash.sha512.keyword”
}
},
“sum_of_duplicates”: {
“sum_bucket”: {
“buckets_path”: “perFileAggregation._count”
}
}
}
}

Anyone got any ideas? Do I need grafana 6 to achieve this?

We now have upgraded to version 6 of grafana. Can anyone help me craft a query for elasticsearch in grafana for the above?