# Rollover policy with date math not work.Date stay "old" and not changed to next day

**URL:** <https://discuss.elastic.co/t/rollover-policy-with-date-math-not-work-date-stay-old-and-not-changed-to-next-day/281158>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [August 12, 2021, 6:46am UTC](https://discuss.elastic.co/t/rollover-policy-with-date-math-not-work-date-stay-old-and-not-changed-to-next-day/281158 "2021-08-12T06:46:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anna.kuranda](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@anna.kuranda](https://discuss.elastic.co/u/anna.kuranda)\
**Post date:** [August 12, 2021, 6:46am UTC](https://discuss.elastic.co/t/rollover-policy-with-date-math-not-work-date-stay-old-and-not-changed-to-next-day/281158/1 "2021-08-12T06:46:15Z")

</div>

I have issue with rollover using date math Elastic ver 7.13. Tried all recommendations from this site but it still not rollover using new date.Please tell me what wrong configured?  
My configuration:  
**Template:**  
`Preformatted text`PUT /\_index\_template/rwr\_template

```auto
{
  "index_patterns": [
    "*base_elements_rwr*"
  ],
  "priority": 0,
  "template": {
    "settings": {
      "index.lifecycle.name": "rwr_size_policy",
      "index.lifecycle.rollover_alias": "rwr_alias",
      "index.lifecycle.parse_origination_date":true,
      
      "number_of_shards": 1,
      "number_of_replicas": 0
      
    },
    "mappings": {
      "properties": {...

```

**Policy:**

```auto
PUT _ilm/policy/rwr_size_policy
{
  "policy": {
    "phases": {
      "hot": {                                
        "actions": {
          "rollover": {
            "max_size": "1gb"
          }
        }
      },
      "delete": {
        "min_age": "3d",
        "actions": {
          "delete": {}
        }
      }....

```

**Create index by date math:**  
`Preformatted text`PUT %3Cbase\_elements\_rwr-%7Bnow%2Fd%7D-000001%3E  
As result :base\_elements\_rwr-2021.08.12-000001

**Alias:**

```auto
POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "base_elements_rwr-2021.08.12-000001",
        "alias": "rwr_alias",
        "is_write_index" : true
      }
    }.....

```

**Explain command result**

```auto
{
  "indices" : {
    "base_elements_rwr-2021.08.12-000001" : {
      "index" : "base_elements_rwr-2021.08.12-000001",
      "managed" : true,
      "policy" : "rwr_size_policy",
      "lifecycle_date_millis" : 1628726400000,
      "age" : "6.7h",
      "phase" : "hot",
      "phase_time_millis" : 1628748130406,
      "action" : "complete",
      "action_time_millis" : 1628750188345,
      "step" : "complete",
      "step_time_millis" : 1628750188345,
      "phase_execution" : {
        "policy" : "rwr_size_policy",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "1gb"
            }
          }
        },
        "version" : 1,
        "modified_date_in_millis" : 1628747995514
      }........

```

---

<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:** [August 16, 2021, 3:16am UTC](https://discuss.elastic.co/t/rollover-policy-with-date-math-not-work-date-stay-old-and-not-changed-to-next-day/281158/2 "2021-08-16T03:16:58Z")

</div>

I don't believe you can currently use date math in the definitions like this.

---

<div class="post-metadata">

**Author:** ![anna.kuranda](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@anna.kuranda](https://discuss.elastic.co/u/anna.kuranda)\
**Post date:** [August 17, 2021, 8:21am UTC](https://discuss.elastic.co/t/rollover-policy-with-date-math-not-work-date-stay-old-and-not-changed-to-next-day/281158/3 "2021-08-17T08:21:53Z")

</div>

Rechecked few times

---

<div class="post-metadata">

**Author:** ![anna.kuranda](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@anna.kuranda](https://discuss.elastic.co/u/anna.kuranda)\
**Post date:** [August 17, 2021, 8:23am UTC](https://discuss.elastic.co/t/rollover-policy-with-date-math-not-work-date-stay-old-and-not-changed-to-next-day/281158/4 "2021-08-17T08:23:35Z")

</div>

May be you need additional info ?Please what information can I send you ?

---

<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:** [September 14, 2021, 8:24am UTC](https://discuss.elastic.co/t/rollover-policy-with-date-math-not-work-date-stay-old-and-not-changed-to-next-day/281158/5 "2021-09-14T08:24:20Z")

</div>

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