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

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?

Use the bytes query parameter as described in the documentation.

GET _cat/indices?v&bytes=unit

The unit can be one of these described in this documentation.

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.

1 Like

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.

What is your output?

I get the same output as without the unit parameter

You need to share your request and output.

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?

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.

only in the column header not every line.

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

You can check the options here in the documentation.

1 Like