# Document count by index name

**URL:** <https://discuss.elastic.co/t/document-count-by-index-name/315477>\
**Category:** Elasticsearch\
**Created:** [September 29, 2022, 4:06pm UTC](https://discuss.elastic.co/t/document-count-by-index-name/315477 "2022-09-29T16:06:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![S-elk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s-elk/32/98464_2.png) [@S-elk](https://discuss.elastic.co/u/S-elk)\
**Post date:** [September 29, 2022, 4:06pm UTC](https://discuss.elastic.co/t/document-count-by-index-name/315477/1 "2022-09-29T16:06:23Z")

</div>

Hello!

Im trying to get the document count by index but I have only been able to get a total count or the count per index of a few.

attempts:

```auto
GET */_search
{
  "size": 0,
  "aggs": {
    "indices": {
      "terms": {
        "field": "_index"
      }
    }
  }
}

GET _cat/indices?v&h=docs.count
GET _cat/indices?v&h=docs.count&h=index

```

Any idea?

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [September 29, 2022, 4:57pm UTC](https://discuss.elastic.co/t/document-count-by-index-name/315477/2 "2022-09-29T16:57:49Z")

</div>

Hi @S-elk

You want like this:

`GET _cat/indices?v&h=index,docs.count`

```auto
index docs.count
idx_script_tst 1
test 2
idx_movies 999

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 27, 2022, 4:58pm UTC](https://discuss.elastic.co/t/document-count-by-index-name/315477/3 "2022-10-27T16:58:17Z")

</div>

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