# I need to get store.size in GB from \_cat/indices for all indices

**URL:** <https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566>\
**Category:** Kibana\
**Created:** [February 5, 2024, 8:08pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566 "2024-02-05T20:08:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [February 5, 2024, 8:08pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/1 "2024-02-05T20:08:30Z")

</div>

I need to get store.size in GB from \_cat/indices for all indices in order to load the command results in excel and process the results in excel.  
That's what I need the store.size column to be all rows in the same measureת GB or MB, but not mixed.  
Any idea how to do it?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 5, 2024, 8:15pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/2 "2024-02-05T20:15:29Z")

</div>

> [@mpniel](#):
>
> Any idea how to do it?

Use the `bytes` query parameter as described in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html#cat-indices-api-query-params).

```auto
GET _cat/indices?v&bytes=unit

```

The unit can be one of these described in this [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#byte-units).

For example if you want MB use `mb`, if you want `GB` use `gb`.

If you use `gb`, anything smaller than 1 GB will not show up, so it would be better to use a smaller unit and convert it later.

---

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [February 5, 2024, 8:22pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/3 "2024-02-05T20:22:11Z")

</div>

It doesn't work on my 7.5.1 version.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 5, 2024, 8:25pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/4 "2024-02-05T20:25:24Z")

</div>

> [@mpniel](#):
>
> It doesn't work on my 7.5.1 version.

It should work, this exists on version 7.5 as you can check on the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/cat-indices.html#cat-indices-api-query-params).

What is your output?

---

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [February 5, 2024, 10:34pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/5 "2024-02-05T22:34:20Z")

</div>

I get the same output as without the unit parameter

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 5, 2024, 11:29pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/6 "2024-02-05T23:29:46Z")

</div>

You need to share your request and output.

---

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [February 7, 2024, 4:40pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/7 "2024-02-07T16:40:43Z")

</div>

Now it works ok.  
But ‏the store.size is displayed as a number without unit.  
Is it possible to display also the unit in the column header?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 7, 2024, 4:42pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/8 "2024-02-07T16:42:39Z")

</div>

> [@mpniel](#):
>
> Is it possible to display also the unit in the column header?

I don't think so, the cat API are pretty simple.

You are already specifying the unit in the request, there is no need to duplicat it in every line.

---

<div class="post-metadata">

**Author:** ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)\
**Post date:** [February 7, 2024, 4:50pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/9 "2024-02-07T16:50:07Z")

</div>

only in the column header not every line.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 7, 2024, 5:30pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/10 "2024-02-07T17:30:55Z")

</div>

As mentioned, it is not possible, the cat API is pretty simple.

You can check the options here in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html).

---

<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:** [March 6, 2024, 5:31pm UTC](https://discuss.elastic.co/t/i-need-to-get-store-size-in-gb-from-cat-indices-for-all-indices/352566/11 "2024-03-06T17:31:42Z")

</div>

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