# Dynamic Template Mapping not Being Applied

**URL:** <https://discuss.elastic.co/t/dynamic-template-mapping-not-being-applied/45801>\
**Category:** Elasticsearch\
**Created:** [March 30, 2016, 1:38pm UTC](https://discuss.elastic.co/t/dynamic-template-mapping-not-being-applied/45801 "2016-03-30T13:38:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxwell\_Flanders](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Maxwell\_Flanders](https://discuss.elastic.co/u/Maxwell_Flanders)\
**Post date:** [March 30, 2016, 1:38pm UTC](https://discuss.elastic.co/t/dynamic-template-mapping-not-being-applied/45801/1 "2016-03-30T13:38:01Z")

</div>

I have placed a template mapping for an index that doesn't seem to be being applied when a new matching index is created, and I can't seem to figure out why. The template is supposed to make all string fields in an index "not\_analyzed". I have even used this identical dynamic template on other indices and had it work. This is the template:

`{ "nginx" : { "order" : 0, "template" : "x-*-nginx-*", "settings" : { "index" : { "refresh_interval" : "5s" } }, "mappings" : { "nginx" : { "dynamic_templates" : [{ "notanalyzed" : { "mapping" : { "index" : "not_analyzed", "doc_values" : "true", "type" : "string" }, "match_mapping_type" : "string", "match" : "*" } }] } }, "aliases" : { } } }`

and here is the mapping of the index that created that should have applied that template, but didnt:

`{ "x-holding-nginx-2016.03.30" : { "aliases" : { }, "mappings" : { "nginx" : { "properties" : { "@timestamp" : { "type" : "date", "format" : "strict_date_optional_time||epoch_millis" }, "@version" : { "type" : "string" }, "agent" : { "type" : "string" }, "auth" : { "type" : "string" }, "beat" : { "properties" : { "hostname" : { "type" : "string" }, "name" : { "type" : "string" } } }, "bytes" : { "type" : "long" }, "client" : { "type" : "string" }, "clientip" : { "type" : "string" }, "count" : { "type" : "long" }, "device" : { "type" : "string" }, "errormessage" : { "type" : "string" }, "fields" : { "properties" : { "type" : { "type" : "string" } } }, "geoip" : { "properties" : { "area_code" : { "type" : "long" }, "city_name" : { "type" : "string" }, "continent_code" : { "type" : "string" }, "country_code2" : { "type" : "string" }, "country_code3" : { "type" : "string" }, "country_name" : { "type" : "string" }, "dma_code" : { "type" : "long" }, "ip" : { "type" : "string" }, "latitude" : { "type" : "double" }, "location" : { "type" : "double" }, "longitude" : { "type" : "double" }, "postal_code" : { "type" : "string" }, "real_region_name" : { "type" : "string" }, "region_name" : { "type" : "string" }, "timezone" : { "type" : "string" } } }, "host" : { "type" : "string" }, "httpversion" : { "type" : "string" } } } } } }`

---

<div class="post-metadata">

**Author:** ![Maxwell\_Flanders](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Maxwell\_Flanders](https://discuss.elastic.co/u/Maxwell_Flanders)\
**Post date:** [March 31, 2016, 11:47am UTC](https://discuss.elastic.co/t/dynamic-template-mapping-not-being-applied/45801/2 "2016-03-31T11:47:37Z")

</div>

Figured out the problem guys. I set the new template at ~8:30PM US-Eastern time, but because elasticsearch was working in UTC, it had ALREADY started the days new indices before I set the template. Silly mistake, but worth noting, watch your time zones people.

thanks!

---

<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:** [July 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/dynamic-template-mapping-not-being-applied/45801/3 "2017-07-05T23:03:34Z")

</div>


