Get quick access to a document count for a data stream, an index, or an entire cluster. The document count only includes live documents, not deleted documents which have not yet been removed by the merge process.
IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the count API.
Required authorization
- Index privileges:
read
Query parameters
-
A comma-separated list of columns names to display. It supports simple wildcards.
Values are
epoch,t,time,timestamp,ts,hms,hhmmss,count,dc,docs.count, ordocsCount. -
List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting
:ascor:descas a suffix to the column name.
GET
/_cat/count
curl \
--request GET 'http://api.example.com/_cat/count'
Response examples (200)
Single data stream or index count
A successful response from `GET /_cat/count/my-index-000001?v=true&format=json`. It retrieves the document count for the `my-index-000001` data stream or index.
[
{
"epoch": "1475868259",
"timestamp": "15:24:20",
"count": "120"
}
]
A successful response from `GET /_cat/count?v=true&format=json`. It retrieves the document count for all data streams and indices in the cluster.
[
{
"epoch": "1475868259",
"timestamp": "15:24:20",
"count": "121"
}
]