Template Post Fail


(Walker) #1

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"
      }
    },
  }

(David Pilato) #2

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


(Walker) #3

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


(system) #4

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