# Getting error while creating template in kibana 5.3

**URL:** <https://discuss.elastic.co/t/getting-error-while-creating-template-in-kibana-5-3/303289>\
**Category:** Kibana\
**Created:** [April 26, 2022, 1:02pm UTC](https://discuss.elastic.co/t/getting-error-while-creating-template-in-kibana-5-3/303289 "2022-04-26T13:02:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangeshmj1992](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mangeshmj1992](https://discuss.elastic.co/u/mangeshmj1992)\
**Post date:** [April 26, 2022, 1:02pm UTC](https://discuss.elastic.co/t/getting-error-while-creating-template-in-kibana-5-3/303289/1 "2022-04-26T13:02:05Z")

</div>

Hello team,  
I am using below query in kibana 5.3 to create template but getting below error:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: template is missing;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: template is missing;"
  },
  "status": 400
}

```

template:

```auto
PUT _template/regulatoryagency
{
  "regulatoryagency": {
    "order": 0,
    "template": "prod:regulatoryagency*",
    "settings": {
      "index": {
       "refresh_interval": "60s",
	   
	   
        "analysis": {
          "filter": {
            "eGram_filter": {
              "token_chars": [
                "letter",
                "digit",
                "punctuation",
                "symbol"
              ],
              "min_gram": "2",
              "type": "edge_ngram",
              "max_gram": "20"
            }
          },
          "analyzer": {
            "eGram_analyzer": {
              "filter": [
                "lowercase",
                "asciifolding",
                "eGram_filter"
              ],
              "type": "custom",
              "tokenizer": "whitespace"
            }
          }
        }
      }
      }
    },
      "mappings": {
      "radoc": {
        "properties": {
          "agency": {
            "type": "text"
          },
          "customs_area_code": {
            "type": "text"
          },
          "dangerous_goods_commodity_ids": {
            "type": "text"
          },
          "effective_date": {
            "type": "date"
          },
          "exception_process_qualifiers": {
            "type": "text"
          },
          "expiration_date": {
            "type": "date"
          },
          "hsnumber": {
            "type": "text",
            "fields": {
              "exact": {
                "type": "text"
              }
            },
            "analyzer": "eGram_analyzer"
          },
          "intended_use_codes": {
            "type": "text"
          },
          "map_id": {
            "type": "text"
          },
          "produc_categories": {
            "type": "text"
          },
          "program": {
            "type": "text"
          },
          "restriction_id": {
            "type": "text"
          },
          "version": {
            "type": "text"
          }
        }
      },
      "doc": {
        "properties": {
          "agency": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "customs_area_code": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "effective_date": {
            "type": "date"
          },
          "expiration_date": {
            "type": "date"
          },
          "hsnumber": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            },
            "analyzer": "eGram_analyzer"
          },
          "intended_use_codes": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "map_id": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "product_categories": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "program": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "restriction_id": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "version": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          }
        }
        }
    },
    "aliases": {}
  }

```

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [April 26, 2022, 4:14pm UTC](https://discuss.elastic.co/t/getting-error-while-creating-template-in-kibana-5-3/303289/2 "2022-04-26T16:14:17Z")

</div>

Hi

Have you tried it like this?

> [@Elasticsearch 5.3, how to make keyword type not analyzed](https://discuss.elastic.co/t/elasticsearch-5-3-how-to-make-keyword-type-not-analyzed/98132):
>
> I am using elasticsearch 5.3, here is my definition of index template: PUT /\_template/mytemplate { "template": "myindex\_\*", "order" : 1, "settings": { "number\_of\_shards" : 1, "number\_of\_replicas" : 2 }, "mappings" : { "log" : { "\_all" : {"enabled" : false, "omit\_norms" : true}, "\_source" : {"enabled" : false }, "properties" : { "tags" : { "type" : "keyword" }, "device\_os" : { …

So removing the root JSON property `regulatoryagency`

```auto
PUT _template/regulatoryagency
{
    "order": 0,

```

---

<div class="post-metadata">

**Author:** ![mangeshmj1992](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mangeshmj1992](https://discuss.elastic.co/u/mangeshmj1992)\
**Post date:** [April 27, 2022, 8:22am UTC](https://discuss.elastic.co/t/getting-error-while-creating-template-in-kibana-5-3/303289/3 "2022-04-27T08:22:16Z")

</div>

Thank you so much @matw for quick reponse. Its worked for me

---

<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:** [May 25, 2022, 8:22am UTC](https://discuss.elastic.co/t/getting-error-while-creating-template-in-kibana-5-3/303289/4 "2022-05-25T08:22:42Z")

</div>

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