Get a document count
- GET /_cat/count/{index}
- GET /_cat/count
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.
- Index privileges:
read
Path Parameters
-
indexIndexName | IndexNameoptional -
A comma-separated list of data streams, indices, and aliases used to limit the request. It supports wildcards (
*). To target all data streams and indices, omit this parameter or use*or_all.Leave it out to use
/_cat/count.
Query Parameters
-
hCatCountColumns A comma-separated list of columns names to display. It supports simple wildcards.
Supported values include:
epoch(ort,time): The Unix epoch time in seconds since 1970-01-01 00:00:00.timestamp(orts,hms,hhmmss): The current time in HH:MM:SS format.count(ordc,docs.count,docsCount): The document count in the cluster or index.
-
Values:
epochttimetimestamptshmshhmmsscountdcdocs.countdocsCount -
sNames 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.