# Problem creating a template 7.5

**URL:** https://discuss.elastic.co/t/problem-creating-a-template-7-5/259397
**Category:** Elasticsearch
**Created:** [December 22, 2020, 2:53pm UTC](https://discuss.elastic.co/t/problem-creating-a-template-7-5/259397 "2020-12-22T14:53:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)
#### Post date: [December 22, 2020, 2:53pm UTC](https://discuss.elastic.co/t/problem-creating-a-template-7-5/259397/1 "2020-12-22T14:53:20Z")

</div>

Hi, when I try to create an index template I get this error, I have checked multiple times and seems to be all ok.

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "unknown key [mapping] in the template "
      }
    ],
    "type": "parse_exception",
    "reason": "unknown key [mapping] in the template "
  },
  "status": 400
}

```

this is my template

````auto
PUT _template/tdp--index-template
{
  "index_patterns": [
      "tdp-*"
    ],
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 1
    },
  "mapping": {
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "@version": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "category": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "host": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "metric_agregation": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "metric_name": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "metric_unit": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "metric_value": {
        "type": "float"
      },
      "namespace": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "path": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "resource_id": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "resource_name": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "service": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "timestamp": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "type": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }
    }
  }
}
```
````

---

<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: [December 22, 2020, 2:57pm UTC](https://discuss.elastic.co/t/problem-creating-a-template-7-5/259397/2 "2020-12-22T14:57:30Z")

</div>

I think [the doc says](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/indices-templates-v1.html) to use `mappings`.

---

<div class="post-metadata">

### Author: ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)
#### Post date: [December 22, 2020, 3:00pm UTC](https://discuss.elastic.co/t/problem-creating-a-template-7-5/259397/3 "2020-12-22T15:00:54Z")

</div>

🤦‍♂️ 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: [January 19, 2021, 3:01pm UTC](https://discuss.elastic.co/t/problem-creating-a-template-7-5/259397/4 "2021-01-19T15:01:12Z")

</div>

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