How to get an index rollover finished time

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?

It does contain that, yes - Explain lifecycle API | Elasticsearch Guide [7.16] | Elastic

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

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

{
    "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.

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.

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? :rofl:

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.

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