# Index lifecycle policy not applied to active index

**URL:** <https://discuss.elastic.co/t/index-lifecycle-policy-not-applied-to-active-index/179228>\
**Category:** Elasticsearch\
**Created:** [May 1, 2019, 4:32pm UTC](https://discuss.elastic.co/t/index-lifecycle-policy-not-applied-to-active-index/179228 "2019-05-01T16:32:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![john.hoogeveen](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@john.hoogeveen](https://discuss.elastic.co/u/john.hoogeveen)\
**Post date:** [May 1, 2019, 4:32pm UTC](https://discuss.elastic.co/t/index-lifecycle-policy-not-applied-to-active-index/179228/1 "2019-05-01T16:32:55Z")

</div>

Hello,

I have created a new ELK 7.0 stack and am struggling with index roll over.  
Currently I have a packetbeat-7.0.0-2019.04.21-000001 index that is 55gb large, the alias of that index is packetbeat-7.0.0.  
The attached lifecycle policy is more or less the basis policy, 50gigabytes but max age of 6 hours  
Below is the json output of the policy

```auto
{
    "policy": {
        "phases": {
            "hot": {
                "min_age": "0ms",
                "actions": {
                    "rollover": {
                        "max_age": "6h",
                        "max_size": "50gb"
                    }
                }
            }
        }
    }
}

```

When I check the phase definition on the index it gives the following output

```auto
{
  "policy": "packetbeat-7.0.0",
  "phase_definition": {
    "min_age": "0ms",
    "actions": {
      "rollover": {
        "max_size": "50gb",
        "max_age": "30d"
      }
    }
  },
  "version": 1,
  "modified_date_in_millis": 1555844316520
}

```

GET packetbeat-7.0.0-2019.04.21-000001/\_ilm/explain gives the following output

```auto
{
  "indices" : {
    "packetbeat-7.0.0-2019.04.21-000001" : {
      "index" : "packetbeat-7.0.0-2019.04.21-000001",
      "managed" : true,
      "policy" : "packetbeat-7.0.0",
      "lifecycle_date_millis" : 1555844317187,
      "phase" : "hot",
      "phase_time_millis" : 1555844317507,
      "action" : "rollover",
      "action_time_millis" : 1555844530404,
      "step" : "check-rollover-ready",
      "step_time_millis" : 1555844530404,
      "phase_execution" : {
        "policy" : "packetbeat-7.0.0",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "50gb",
              "max_age" : "30d"
            }
          }
        },
        "version" : 1,
        "modified_date_in_millis" : 1555844316520
      }
    }
  }
}

```

I was expecting a rollover based on the data size of 50gb but nothing happened.  
What should I change or do to start the automatic roll over to a new index after eq. 6 hours?  
thnxz  
John

---

<div class="post-metadata">

**Author:** ![john.hoogeveen](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@john.hoogeveen](https://discuss.elastic.co/u/john.hoogeveen)\
**Post date:** [May 1, 2019, 5:18pm UTC](https://discuss.elastic.co/t/index-lifecycle-policy-not-applied-to-active-index/179228/2 "2019-05-01T17:18:10Z")

</div>

Hmmm, can it be that the size being shown is 55gb while the primaries is "only" 28gb and not near the 50gb limit defined in the policy?  
GET packetbeat-7.0.0-2019.04.21-000001/\_stats

```auto
{
  "_shards" : {
    "total" : 2,
    "successful" : 2,
    "failed" : 0
  },
  "_all" : {
    "primaries" : {
      "docs" : {
        "count" : 81593179,
        "deleted" : 0
      },
      "store" : {
        "size_in_bytes" : 30066485090
      },
      "indexing" : {
        "index_total" : 72882006,
        "index_time_in_millis" : 53494651,
        "index_current" : 0,
        "index_failed" : 0,
        "delete_total" : 0,
        "delete_time_in_millis" : 0,
        "delete_current" : 0,
        "noop_update_total" : 0,
        "is_throttled" : false,
        "throttle_time_in_millis" : 0
      },

```

---

<div class="post-metadata">

**Author:** ![john.hoogeveen](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@john.hoogeveen](https://discuss.elastic.co/u/john.hoogeveen)\
**Post date:** [May 8, 2019, 7:13pm UTC](https://discuss.elastic.co/t/index-lifecycle-policy-not-applied-to-active-index/179228/3 "2019-05-08T19:13:26Z")

</div>

Fixed it.  
I removed the lifecycle policy from the index and added it again.  
Now it is working as expected

---

<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:** [June 5, 2019, 7:13pm UTC](https://discuss.elastic.co/t/index-lifecycle-policy-not-applied-to-active-index/179228/4 "2019-06-05T19:13:26Z")

</div>

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