# How to get an index rollover finished time

**URL:** <https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [December 26, 2021, 3:43am UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922 "2021-12-26T03:43:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnPhilip](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@JohnPhilip](https://discuss.elastic.co/u/JohnPhilip)\
**Post date:** [December 26, 2021, 3:43am UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922/1 "2021-12-26T03:43:38Z")

</div>

Hi, all, I want to know when does an index finished it's rollover action, is there any api to get this infomation? can `_ilm/explain` show this info?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 28, 2021, 9:31pm UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922/4 "2021-12-28T21:31:46Z")

</div>

It does contain that, yes - [Explain lifecycle API | Elasticsearch Guide [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html)

---

<div class="post-metadata">

**Author:** ![JohnPhilip](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@JohnPhilip](https://discuss.elastic.co/u/JohnPhilip)\
**Post date:** [December 29, 2021, 2:54am UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922/5 "2021-12-29T02:54:12Z")

</div>

First of all, thank you Mark. Yes, I've seen

> [@warkolm](#):
>
> [Explain lifecycle API | Elasticsearch Guide [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html)

this, but it seems that it can only show the current lifecycle state info. For example, I set an index lifecycle management strategy like below

```json
{
    "policy": {
      "phases": {
        "hot": {
          "actions": {
            "rollover": {
                "max_size": "50gb",
                "max_age": "30d"
             }
          }
        },
        "warm": {
          "actions": {
            "forcemerge": {
              "max_num_segments": 1
            }
          }
        },
        "cold": {
          "min_age": "30d",
          "actions": {
            "allocate": {
              "number_of_replicas": 0
            }
          }
        },
        "delete": {
          "min_age": "60d",
          "actions": {
            "delete": {}
          }
        }
      }
    }
  }

```

and when it rolled over and entered the delete phase, how can I know when it was rolled over? I ask this because I wanna monitor the disk space usage and delete the oldest rolled over index when disk space is not enough.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 29, 2021, 3:54am UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922/6 "2021-12-29T03:54:08Z")

</div>

Ok, check out `GET _cat/indices?h=i,cd&v`. It'll show the index name (`i`) and the creation date (`cd`).

Use `?help` to show all the possible columns you can get. That might be easier.

---

<div class="post-metadata">

**Author:** ![JohnPhilip](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@JohnPhilip](https://discuss.elastic.co/u/JohnPhilip)\
**Post date:** [December 29, 2021, 5:07am UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922/7 "2021-12-29T05:07:33Z")

</div>

Yes, I know this api can get the index name and creation date info, but I was puzzled about if I use creation date to determine which index is the oldest, I will lose some important data. For example, I have two index, one is `test1-000001` and another is `test2-000001`, they all rolled over when they achieve 50GB, the difference of them is that **test1** have a lot of data to write in per day while **test2** have much less data, and as time goes by, maybe one month later, **test1** is rolled to `test1-001111` while **test2** is rolled only to `test2-000010`. And I found the disk space is not enough so I decide to choose one index to delete. If I use creation date, there is no doubt that `test2-XXXXXX` will be delete first which is not I supposed to. So I want to find a way to extract an index's rolled over time to decide which one is the **oldest** that I should delete. So do you know what I'm saying Mark? 🤣

---

<div class="post-metadata">

**Author:** ![JohnPhilip](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@JohnPhilip](https://discuss.elastic.co/u/JohnPhilip)\
**Post date:** [December 29, 2021, 10:28am UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922/8 "2021-12-29T10:28:53Z")

</div>

I draw a picture to show my puzzle, that's why I want to use the rolled over time of an index to decide which one is the one I should delete.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/a/ca891c3c8cb600127af96658d35531a4c4b0df47.png)

---

<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:** [January 26, 2022, 10:29am UTC](https://discuss.elastic.co/t/how-to-get-an-index-rollover-finished-time/292922/9 "2022-01-26T10:29:33Z")

</div>

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