# ES 7.14 does create index from template but ignore mappings and replicas

**URL:** https://discuss.elastic.co/t/es-7-14-does-create-index-from-template-but-ignore-mappings-and-replicas/283352
**Category:** Elasticsearch
**Created:** [September 5, 2021, 12:02am UTC](https://discuss.elastic.co/t/es-7-14-does-create-index-from-template-but-ignore-mappings-and-replicas/283352 "2021-09-05T00:02:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![luigius](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@luigius](https://discuss.elastic.co/u/luigius)
#### Post date: [September 5, 2021, 12:02am UTC](https://discuss.elastic.co/t/es-7-14-does-create-index-from-template-but-ignore-mappings-and-replicas/283352/1 "2021-09-05T00:02:34Z")

</div>

Hi,  
I create a template:

```auto
PUT _template/logstash
{
     "index_patterns" : [
      "logstash-*"
    ],
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "filebeat",
          "rollover_alias" : "logstash-rollover-"
        },
        "mapping" : {
          "total_fields" : {
            "limit" : "10000"
          }
        },
        "refresh_interval" : "5s",
        "number_of_shards" : "1",
        "max_docvalue_fields_search" : "200",
        "number_of_replicas" : "0"
      }
    },
    "mappings" : {
      "properties" : {
        "dstgeoip" : {
          "properties" : {
            "country" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "ignore_above" : 256,
                  "type" : "keyword"
                }
              }
            },
            "city" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "ignore_above" : 256,
                  "type" : "keyword"
                }
              }
            },
            "latitude" : {
              "type" : "half_float"
            },
            "location" : {
              "type" : "geo_point"
            },
            "longitude" : {
              "type" : "half_float"
            }
          }
        },
        "srcgeoip" : {
          "properties" : {
            "country" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "ignore_above" : 256,
                  "type" : "keyword"
                }
              }
            },
            "city" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "ignore_above" : 256,
                  "type" : "keyword"
                }
              }
            },
             "latitude" : {
              "type" : "half_float"
            },
            "location" : {
              "type" : "geo_point"
            },
            "longitude" : {
              "type" : "half_float"
            }
          }
        }
      }
    },
    "aliases" : { }
  }

```

then via td-agent I create the index (here the output for the td-agent):

```auto
<match syslog-Sierra**> @type elasticsearch suppress_type_name true logstash_format true template_overwrite false
  hosts https://yyyy:xxxx@localhost:9200
  ssl_verify false
  ca_file /etc/kibana/elasticsearch-ca.pem
   logstash_prefix logstash-Sierra-
  <buffer>
    flush_interval 5s # for testing
  </buffer>
</match>
}

```

elastic reports the index created using the template  
`[2021-09-04T16:40:29,337][INFO][o.e.c.m.MetadataCreateIndexService] [monitor] [logstash-home--2021.09.04] creating index, cause [auto(bulk api)], templates [logstash], shards [1]/[1]`

but the index still has replicas set to one and the data fields are still in the wrong mapping.

Thanks

---

<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: [September 5, 2021, 10:21pm UTC](https://discuss.elastic.co/t/es-7-14-does-create-index-from-template-but-ignore-mappings-and-replicas/283352/2 "2021-09-05T22:21:20Z")

</div>

What's the output from `_cat/templates?v`?

---

<div class="post-metadata">

### Author: ![luigius](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@luigius](https://discuss.elastic.co/u/luigius)
#### Post date: [October 1, 2021, 3:46am UTC](https://discuss.elastic.co/t/es-7-14-does-create-index-from-template-but-ignore-mappings-and-replicas/283352/3 "2021-10-01T03:46:57Z")

</div>

Sorry for the delay but never got the message informing me of your reply.  
here are the results of \_cat/templates/_logstash_?v (otherwise was too long):

```auto
name index_patterns order version composed_of
.monitoring-logstash [.monitoring-logstash-7-*] 0 7140099 
.logstash-management [.logstash] 0             
logstash [logstash-*] 0             
logstash [logstash-*] 0 []

```

---

<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: [October 29, 2021, 3:47am UTC](https://discuss.elastic.co/t/es-7-14-does-create-index-from-template-but-ignore-mappings-and-replicas/283352/4 "2021-10-29T03:47:47Z")

</div>

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