# Template Post Fail

**URL:** <https://discuss.elastic.co/t/template-post-fail/120275>\
**Category:** Elasticsearch\
**Created:** [February 17, 2018, 12:16am UTC](https://discuss.elastic.co/t/template-post-fail/120275 "2018-02-17T00:16:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [February 17, 2018, 12:16am UTC](https://discuss.elastic.co/t/template-post-fail/120275/1 "2018-02-17T00:16:29Z")

</div>

Trying to create custom template. Pulled the dynamic template created, made modifications and then used Kibana's dev tool to `PUT` it into Elasticsearch. Tested the template and saw an error with my config. but now I can't `PUT` my modified version up. I tried deleting anything with the same template name and when I do a GET \_all, I don't see my template. Here's the error I get followed by the template I am trying to add.

```
{
  "error": {
    "root_cause": [
      {
        "type": "resource_already_exists_exception",
        "reason": "index [{/J4PdWhXDQHaKh8eeWAzduQ] already exists",
        "index_uuid": "J4PdWhXDQHaKh8eeWAzduQ",
        "index": "{"
      }
    ],
    "type": "resource_already_exists_exception",
    "reason": "index [{/J4PdWhXDQHaKh8eeWAzduQ] already exists",
    "index_uuid": "J4PdWhXDQHaKh8eeWAzduQ",
    "index": "{"
  },
  "status": 400
}

```

Template (Cut down on fields to fit inside the post character limit)

```
 {
    "template": "dmarcxml"
    "index_patterns": "dmarcxml-*"
    "settings": {
      "index": {
        "refresh_interval": "5s",
        "number_of_shards": 1,
        "number_of_replicas" : 0,
      }
    },
    "mappings": {
      "_default_": {
        "properties": {
          "@timestamp": {
            "type": "date"
      }
    },
  }
```

---

<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:** [February 17, 2018, 7:18am UTC](https://discuss.elastic.co/t/template-post-fail/120275/2 "2018-02-17T07:18:09Z")

</div>

We need to see how you pass the json to elasticsearch. Which exact request. Which one causes that...

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [February 18, 2018, 10:57pm UTC](https://discuss.elastic.co/t/template-post-fail/120275/3 "2018-02-18T22:57:24Z")

</div>

I had LOTS of syntax errors. After going through the document and correcting everything, it works fine.

---

<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:** [March 18, 2018, 10:57pm UTC](https://discuss.elastic.co/t/template-post-fail/120275/4 "2018-03-18T22:57:59Z")

</div>

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