Reputation: 41
I want to get documents data count from Jan 2020 to April 2020 in particular index could your please let me know the query.
Upvotes: 1
Views: 1610
Reputation: 217514
Using the _count
endpoint with the following query should do:
GET index/_count <-- change your index name here
{
"query": {
"range": {
"@timestamp": { <-- change your date field here
"gte": "2020-01-01",
"lte": "2020-04-01"
}
}
}
}
Upvotes: 2