# Index Templates file is not being applied. ES \[5.4.6\]

**URL:** https://discuss.elastic.co/t/index-templates-file-is-not-being-applied-es-5-4-6/135747
**Category:** Elasticsearch
**Created:** [June 13, 2018, 2:23pm UTC](https://discuss.elastic.co/t/index-templates-file-is-not-being-applied-es-5-4-6/135747 "2018-06-13T14:23:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Zamir\_Arif](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zamir_arif/32/31894_2.png) [@Zamir\_Arif](https://discuss.elastic.co/u/Zamir_Arif)
#### Post date: [June 13, 2018, 2:23pm UTC](https://discuss.elastic.co/t/index-templates-file-is-not-being-applied-es-5-4-6/135747/1 "2018-06-13T14:23:52Z")

</div>

I have created a template as shown below.

```
GET /_template/
{
  "deal-expense-template": {
    "order": 0,
    "template": "[deal*]",
    "settings": {
      "index": {
        "number_of_shards": "5"
      }
    },
    "mappings": {
      "kafka-connect": {
        "properties": {
          "NO_OF_DEALS": {
            "type": "long"
          },
          "EXPENSE_CODE_DESCRIPTION": {
            "type": "keyword"
          },
          "EXPENSE_CODE": {
            "type": "keyword"
          }
        }
      }
    },
    "aliases": {}
  }
}

```

> I am using Kafka Connect to write data to Elasticsearch which creates the following index.

GET /\_all/\_mapping

```
        {
      "deal-expense-new": {
        "mappings": {
          "kafka-connect": {
            "properties": {
              "EXPENSE_CODE": {
                "type": "text"
              },
              "EXPENSE_CODE_DESCRIPTION": {
                "type": "text"
              },
              "NO_OF_DEALS": {
                "type": "long"
              }
            }
          }
        }
      }

```

When Kafka writes it creates an index called `deal-expense-new` and template would have been applied.

I can find this in logs:

> ```
> [2018-06-13T15:23:37,901][INFO][o.e.c.m.MetaDataCreateIndexService] [lrv141rq] [deal-expense-new] creating index, cause [api], templates [], shards [5]/[1], mappings []
> [2018-06-13T15:23:38,214][INFO][o.e.c.m.MetaDataMappingService] [lrv141rq] [deal-expense-new/lgsxUCd5THCDy9ykoMj5FA] create_mapping [kafka-connect]
> 
> ```

Please let me know If I am doing anything wrong here.

---

<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 11, 2018, 2:24pm UTC](https://discuss.elastic.co/t/index-templates-file-is-not-being-applied-es-5-4-6/135747/2 "2018-07-11T14:24:13Z")

</div>

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