# After changing index template, new index not taking the changes

**URL:** https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465
**Category:** Elasticsearch
**Created:** [August 18, 2020, 4:03pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465 "2020-08-18T16:03:19Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)
#### Post date: [August 18, 2020, 4:03pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/1 "2020-08-18T16:03:19Z")

</div>

Hi,

I am experiencing a weird problem where I am updating an index template by changing the mapping of a timestamp property from date to date\_nano and even when in the definition of template it shows the proper mapping to date\_nano, the new index which is created still showing date and with this the ingestion of data is failing.

I tried multiple things in the sandbox by removing the index, the template, etc, but still happening.

Seems some kind of caching issue, how can I solve it?

Thanks,

Zareh

---

<div class="post-metadata">

### Author: ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)
#### Post date: [August 18, 2020, 4:08pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/2 "2020-08-18T16:08:38Z")

</div>

One more comment, I adjusted the index template to have an extra property, just for testing and to validate if the new index get created with this property, it did not work, the mapping on the new index created still showing the same mapping as the original index template, before any change.

---

<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 18, 2020, 9:00pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/3 "2020-08-18T21:00:43Z")

</div>

Welcome to our community! 😃

Sharing your template would be useful to diagnose this.

---

<div class="post-metadata">

### Author: ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)
#### Post date: [August 19, 2020, 6:51pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/4 "2020-08-19T18:51:22Z")

</div>

The original template:

```auto
    put _template/com.sap.c4c.abap.wf
    {
      "index_patterns": ["com.sap.c4c.abap.wf*"],
      "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 1,
        "index.lifecycle.name": "com.sap.c4c.abap.wf",
        "index.lifecycle.rollover_alias": "com.sap.c4c.abap.wf"
      },
       "mappings": {
        "properties": {
          "beforeimageindicator":{"type" : "keyword"},
          "calculatedfieldindicator":{"type" : "keyword"},
          "client":{"type" : "keyword"},
          "customerid":{"type" : "keyword"},
          "customername":{"type" : "keyword"},
          "dc":{"type" : "keyword"},
          "description":{"type" : "keyword"},
          "fieldoractionname":{"type" : "keyword"},
          "maxconditionsingroup":{"type" : "long"},
          "moname":{"type" : "keyword"},
          "numberofgroups":{"type" : "long"},
          "system":{"type" : "keyword"},
          "tenant":{"type" : "keyword"},
          "tenantrole":{"type" : "keyword"},
          "timestamp":{"type": "date"},
          "timingtypecode":{"type" : "keyword"},
          "totalnoofconditions":{"type" : "long"},
          "typecode":{"type" : "keyword"}
        }
      },
      "version": 1
    }

```

The new template:

```auto
   put _template/com.sap.c4c.abap.wf
    {
      "index_patterns": ["com.sap.c4c.abap.wf*"],
      "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 1,
        "index.lifecycle.name": "com.sap.c4c.abap.wf",
        "index.lifecycle.rollover_alias": "com.sap.c4c.abap.wf"
      },
       "mappings": {
        "properties": {
          "beforeimageindicator":{"type" : "keyword"},
          "calculatedfieldindicator":{"type" : "keyword"},
          "client":{"type" : "keyword"},
          "customerid":{"type" : "keyword"},
          "customername":{"type" : "keyword"},
          "dc":{"type" : "keyword"},
          "description":{"type" : "keyword"},
          "fieldoractionname":{"type" : "keyword"},
          "maxconditionsingroup":{"type" : "long"},
          "moname":{"type" : "keyword"},
          "numberofgroups":{"type" : "long"},
          "system":{"type" : "keyword"},
          "tenant":{"type" : "keyword"},
          "tenantrole":{"type" : "keyword"},
          "timestamp":{"type": "date_nanos"},
          "timingtypecode":{"type" : "keyword"},
          "totalnoofconditions":{"type" : "long"},
          "typecode":{"type" : "keyword"}
        }
      },
      "version": 2
    }`

```

Changing the template worked in 1 elastic cluster, but now I am experiencing the same problem in 2 different elastic clusters.

Basically after updating the index template, I am running the rollover API to move to a new index and apply this settings:

```auto
   POST /com.sap.c4c.abap.wf/_rollover
    {
      "conditions": {
        "max_age": "1d",
        "max_size": "1gb"
      }
    }

```

But like I said, when I look into the mapping of the new index on hot phase, the mapping is from the old index template, and this is the problem, but when I see the index template, it has the proper mapping.

Thanks,

Zareh

---

<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 19, 2020, 9:59pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/5 "2020-08-19T21:59:57Z")

</div>

What is the output from `_cat/templates?v`?

---

<div class="post-metadata">

### Author: ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)
#### Post date: [August 26, 2020, 6:13pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/6 "2020-08-26T18:13:32Z")

</div>

.ml-anomalies- [.ml-anomalies-_] 0 7080099  
.ml-meta [.ml-meta] 0 7080099  
.watch-history-11 [.watcher-history-11_] 2147483647 11  
.ml-inference-000002 [.ml-inference-000002] 0 7080099  
.transform-notifications-000002 [.transform-notifications-_] 0 7080099  
.ml-stats [.ml-stats-_] 0 7080099  
.slm-history [.slm-history-2\*] 2147483647 2  
.monitoring-kibana [.monitoring-kibana-7-_] 0 7000199  
.triggered\_watches [.triggered\_watches_] 2147483647 11  
com.sap.c4c.abap.sessions [com.sap.c4c.abap.sessions\*] 0 2  
.watches [.watches\*] 2147483647 11  
.monitoring-es [.monitoring-es-7-_] 0 7000199  
.monitoring-logstash [.monitoring-logstash-7-_] 0 7000199  
.ml-config [.ml-config] 0 7080099  
.management-beats [.management-beats] 0 70000  
.ml-state [.ml-state\*] 0 7080099  
.logstash-management [.logstash] 0  
ilm-history [ilm-history-2\*] 2147483647 2  
.transform-internal-005 [.transform-internal-005] 0 7080099  
.monitoring-beats [.monitoring-beats-7-_] 0 7000199  
.ml-notifications-000001 [.ml-notifications-000001] 0 7080099  
.kibana-event-log-7.8.0-template [.kibana-event-log-7.8.0-_] 0  
.monitoring-alerts-7 [.monitoring-alerts-7] 0 7000199  
com.sap.c4c.abap.meter [com.sap.c4c.abap.meter\*] 0   
com.sap.c4c.abap.oberon [com.sap.c4c.abap.oberon\*] 0   
com.sap.c4c.abap.api\_calls [com.sap.c4c.abap.api\_calls\*] 0   
com.sap.c4c.hana.backups [com.sap.c4c.hana.backups\*] 0   
com.sap.c4c.abap.bo [com.sap.c4c.abap.bo\*] 0   
com.sap.c4c.abap.wf [com.sap.c4c.abap.wf\*] 0   
com.sap.c4c.hana.hash [com.sap.c4c.hana.hash\*] 0   
com.sap.c4c.abap.sessions [com.sap.c4c.abap.sessions\*] 0   
com.sap.c4c.abap.logon [com.sap.c4c.abap.logon\*] 0   
com.sap.c4c.oberon.analysis [com.sap.c4c.oberon.analysis\*] 0   
com.sap.c4c.hana.size.system [com.sap.c4c.hana.size.system\*] 0   
com.sap.c4c.hana.tables [com.sap.c4c.hana.tables\*] 0   
com.sap.c4c.harmonization [com.sap.c4c.harmonization\*] 0   
com.sap.apm.performance.tracking [com.sap.apm.performance.tracking\*] 0   
com.sap.c4c.abap.bc [com.sap.c4c.abap.bc\*] 0   
com.sap.c4c.hana.size.tenant [com.sap.c4c.hana.size.tenant\*] 0

---

<div class="post-metadata">

### Author: ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)
#### Post date: [August 26, 2020, 6:18pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/7 "2020-08-26T18:18:08Z")

</div>

Hi,

I am observing the same issue with a different index template com.sap.c4c.abap.sessions [com.sap.c4c.abap.sessions\*], same type of issue, the new mapping defined on the template is not reflected in the index, now it is like this

New template:

```auto
PUT _template/com.sap.c4c.abap.sessions
{
  "index_patterns": ["com.sap.c4c.abap.sessions*"],
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 1,
    "index.lifecycle.name": "com.sap.c4c.abap.sessions",
    "index.lifecycle.rollover_alias": "com.sap.c4c.abap.sessions"
  },
   "mappings": {
    "properties": {
      "act_program":{"type" : "keyword"},
      "application_info":{"type" : "keyword"},
      "application": {"type" : "keyword"},
      "category":{"type": "keyword"},
      "client":{"type" : "keyword"},
      "customerid":{"type" : "keyword"},
      "customername":{"type" : "keyword"},
      "dc":{"type" : "keyword"},
      "em_memory":{"type" : "long"},
      "heap_memory":{"type" : "long"},
      "request_time":{"type": "date_nanos"},
      "security_context_id":{"type" : "keyword"},
      "server_name":{"type" : "keyword"},
      "system":{"type" : "keyword"},
      "tenant":{"type" : "keyword"},
      "tenantrole":{"type" : "keyword"},
      "timestamp":{"type": "date_nanos"},
      "user_name":{"type" : "keyword"},
      "username_encrypted":{"type" : "keyword"},
      "system_description":{"type" : "keyword"}
    }
  },
  "version": 2
}

```

Mapping reflected on the index:

```auto
{
  "mappings": {
    "_doc": {
      "properties": {
        "act_program": {
          "type": "keyword"
        },
        "application": {
          "type": "keyword"
        },
        "application_info": {
          "type": "keyword"
        },
        "category": {
          "type": "keyword"
        },
        "client": {
          "type": "keyword"
        },
        "customerid": {
          "type": "keyword"
        },
        "customername": {
          "type": "keyword"
        },
        "dc": {
          "type": "keyword"
        },
        "em_memory": {
          "type": "long"
        },
        "heap_memory": {
          "type": "long"
        },
        **"request_time": {**
 **"type": "date",**
 **"format": "epoch_second"**
 **},**
        "security_context_id": {
          "type": "keyword"
        },
        "server_name": {
          "type": "keyword"
        },
        "system": {
          "type": "keyword"
        },
        "tenant": {
          "type": "keyword"
        },
        "tenantrole": {
          "type": "keyword"
        },
        "timestamp": {
          "type": "date_nanos"
        },
        "user_name": {
          "type": "keyword"
        }
      }
    }
  }
}

```

Basically I am changing the request\_time from date to date\_nanos and same problem.

Zareh

---

<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 27, 2020, 12:52am UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/8 "2020-08-27T00:52:19Z")

</div>

Please make sure you continue to format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you 🙂

Looking at the `_cat` output, it looks like you have multiple mentions of `com.sap.c4c.abap.sessions*`?

---

<div class="post-metadata">

### Author: ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)
#### Post date: [September 1, 2020, 5:06pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/9 "2020-09-01T17:06:09Z")

</div>

Thank you Mark,

At the end I realized that I got caught in the middle of the old and new index template APIs:

Old: /\_template/template\_1  
New: /\_index\_template/template\_1

Seems that I mixed them some way, at the end I was sure to use the new api and everything worked perfectly

Thanks all for your help,

Zareh

---

<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 29, 2020, 5:06pm UTC](https://discuss.elastic.co/t/after-changing-index-template-new-index-not-taking-the-changes/245465/10 "2020-09-29T17:06:12Z")

</div>

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