How to get a count by index id


(Praveen) #1

Help with the query how to get count of each index on a specified time frame


(Praveen) #2

Use the below query to get it
curl -XGET "http://localhost:9200/index*/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"bool": {
"filter": {
"range": {
"@timestamp": {
"gte": "now-2d",
"lt": "now"
}
}
}
}
}, "size" : 0,
"aggs" : {
"keywords" : {
"significant_terms" : {
"field" : "_index"
}
}
}
}'


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.