# Malformed \[mappings\] section for type \[dynamic\_templates\],

**URL:** <https://discuss.elastic.co/t/malformed-mappings-section-for-type-dynamic-templates/188428>\
**Category:** Elasticsearch\
**Created:** [July 2, 2019, 3:08am UTC](https://discuss.elastic.co/t/malformed-mappings-section-for-type-dynamic-templates/188428 "2019-07-02T03:08:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [July 2, 2019, 3:08am UTC](https://discuss.elastic.co/t/malformed-mappings-section-for-type-dynamic-templates/188428/1 "2019-07-02T03:08:39Z")

</div>

Hello I am trying to add the following mapping to my index  
ELK 6.8.0

```auto
PUT _template/logstash-*
{
  "template" : "logstash-*",
  "version" : 60001,
  "settings" : {
    "index.refresh_interval" : "5s",
    "index.number_of_shards" : "1",
    "index.number_of_replicas" : "0",
    "index.mapping.total_fields.limit": "2000"
  },
  "mappings" : {
      "dynamic_templates" : [ {
        "message_field" : {
          "path_match" : "message",
          "match_mapping_type" : "string",
          "mapping" : {
            "type" : "text",
            "norms" : false
          }
        }
      }, {
        "string_fields" : {
          "match" : "*",
          "match_mapping_type" : "string",
          "mapping" : {
            "type" : "text", "norms" : false,
            "fields" : {
              "keyword" : { "type": "keyword", "ignore_above": 256 }
            }
          }
        }
      } ],
      "properties" : {
        "@timestamp": { "type": "date"},
        "@version": { "type": "keyword"},
        "geoip" : {
          "dynamic": true,
          "properties" : {
            "ip": { "type": "ip" },
            "location" : { "type" : "geo_point" },
            "latitude" : { "type" : "half_float" },
            "longitude" : { "type" : "half_float" }
          }
        }
      }
    }
  }

```

and I Keep on getting the following error

```auto
        {
          "error": {
            "root_cause": [
              {
                "type": "illegal_argument_exception",
                "reason": "Malformed [mappings] section for type [dynamic_templates], should include an inner object describing the mapping"
              }
            ],
            "type": "illegal_argument_exception",
            "reason": "Malformed [mappings] section for type [dynamic_templates], should include an inner object describing the mapping"
          },
          "status": 400
        }

```

![image](https://us1.discourse-cdn.com/elastic/original/3X/5/0/50825d100287a8fb9024c055ac8ee2ad27edc08d.png)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 2, 2019, 3:21am UTC](https://discuss.elastic.co/t/malformed-mappings-section-for-type-dynamic-templates/188428/2 "2019-07-02T03:21:56Z")

</div>

It looks like a template for 7.x as there is no type name in it.  
If you're starting a project I'd recommend going to 7.2.0 instead.  
Otherwise add the type name "\_doc" (look at the 6.8 documentation about index templates).

---

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [July 3, 2019, 12:50pm UTC](https://discuss.elastic.co/t/malformed-mappings-section-for-type-dynamic-templates/188428/3 "2019-07-03T12:50:02Z")

</div>

Thank 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:** [July 31, 2019, 12:50pm UTC](https://discuss.elastic.co/t/malformed-mappings-section-for-type-dynamic-templates/188428/4 "2019-07-31T12:50:02Z")

</div>

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