# \_cat/indices data

**URL:** <https://discuss.elastic.co/t/cat-indices-data/195070>\
**Category:** Elasticsearch\
**Created:** [August 13, 2019, 5:50pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070 "2019-08-13T17:50:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorixrebel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rorixrebel/32/41778_2.png) [@rorixrebel](https://discuss.elastic.co/u/rorixrebel)\
**Post date:** [August 13, 2019, 5:50pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070/1 "2019-08-13T17:50:05Z")

</div>

so i'd like to start visualize some of the data from the \_cat apis like indices, volume and replicas, etc.

tried to see if i could scrape the info from .monitoring-es but no dice, is the data from the api somewhere we can pull it from?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 14, 2019, 7:54am UTC](https://discuss.elastic.co/t/cat-indices-data/195070/2 "2019-08-14T07:54:21Z")

</div>

hey,

how about using the [metricbeat elasticsearch module](https://www.elastic.co/guide/en/beats/metricbeat/7.3/metricbeat-module-elasticsearch.html) for this, so you do not have any hassle of parsing things manually?

---

<div class="post-metadata">

**Author:** ![rorixrebel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rorixrebel/32/41778_2.png) [@rorixrebel](https://discuss.elastic.co/u/rorixrebel)\
**Post date:** [August 14, 2019, 1:57pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070/3 "2019-08-14T13:57:50Z")

</div>

tried it and it gave me some good stats but it seems like the module doesn't do index and index\_summary on 6.2 cluster so i'm gonna have to scrape that from somewhere else.

which internal index may contain the index and store size data im looking for?

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [August 14, 2019, 2:19pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070/4 "2019-08-14T14:19:48Z")

</div>

> [@rorixrebel](#):
>
> which internal index may contain the index and store size data im looking for?

You could try the [\_cat/indices API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html), it gives you all the indices with store size, primary store size, docs count and docs deleted count.

For instance, this will return all the indices sorted by name with column headers explaining what each column represents:

```
curl -XGET 'http://localhost:9200/_cat/indices?v&s=index'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .kibana-6 x4RoWEFISwO_5Kwk5Ip8hw 1 1 5 1 106.9kb 53.4kb
green open .kibana_1 EC-zsVoLQBi6dNTwWDuJeg 1 1 4 0 46.5kb 23.2kb
green open .kibana_7 Qci1vY8nTMacksaVpJSgSg 1 1 8 0 57.3kb 28.6kb
green open .monitoring-es-6-2019.08.07 wcvM-3KvR8KDujQV5Y7Wwg 1 1 503096 4048 925.9mb 459.8mb
green open .monitoring-es-6-2019.08.08 Dv-MkmD9QPSr1JW5FVhjkA 1 1 503090 4948 940.5mb 468.5mb
green open .monitoring-es-6-2019.08.09 qBAAVWc4TS-H8v1Ao3ClUg 1 1 502648 4418 925.1mb 467.5mb
green open .monitoring-es-6-2019.08.10 drYDRgmGRp6OqaVTc1cdyw 1 1 502158 4496 929.4mb 461.3mb

```

It should be straight forward to parse this output either in a script or on command line using grep and awk. The following piped commands return the store.size for the indices created on Aug 14:

```
curl -XGET 'http://localhost:9200/_cat/indices?v&s=index' -s | grep 2019.08.14 | awk '{print $3" has store.size: "$9}'   
.monitoring-es-6-2019.08.14 has store.size: 717.9mb
.monitoring-kibana-6-2019.08.14 has store.size: 3.4mb

```

---

<div class="post-metadata">

**Author:** ![rorixrebel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rorixrebel/32/41778_2.png) [@rorixrebel](https://discuss.elastic.co/u/rorixrebel)\
**Post date:** [August 14, 2019, 2:22pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070/5 "2019-08-14T14:22:31Z")

</div>

right, im aware of the cat api results but having a script to hit the api and then reingest it into the cluster seems redundant, if the api has the data it must be somewhere already which is what im trying to get so i can start doing some visualizations, im mostly looking into displaying a graph of indices sizes so i can see volume peaks and trends.

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [August 14, 2019, 2:22pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070/6 "2019-08-14T14:22:35Z")

</div>

Sorry, didn't see the title of this thread, just read the posts. From them it seems you should be able to use \_cat/indices to obtain store sizes for each index.

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [August 14, 2019, 2:24pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070/7 "2019-08-14T14:24:56Z")

</div>

> [@rorixrebel](#):
>
> but having a script to hit the api and then reingest it into the cluster seems redundant

Oh, I get your point.

I don't know if there is a single index you can query for this. I have only used the \_cat/indices myself. Sorry.

---

<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:** [September 11, 2019, 2:24pm UTC](https://discuss.elastic.co/t/cat-indices-data/195070/8 "2019-09-11T14:24:59Z")

</div>

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