# Problem with creating mapping template

**URL:** https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274
**Category:** Elasticsearch
**Created:** [August 7, 2018, 8:14am UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274 "2018-08-07T08:14:38Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Loudone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loudone/32/33365_2.png) [@Loudone](https://discuss.elastic.co/u/Loudone)
#### Post date: [August 7, 2018, 8:14am UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/1 "2018-08-07T08:14:39Z")

</div>

Dear All,

I'm trying to create a mapping template like below:

```
PUT _template/documentum
{
  "index_patterns":"docu_*",
  "version": 1,
  "settings": {
"index.refresh_interval" : "5s"
  },
  "mapping": {
"doc": {
  "properties": {
    "@timestamp": {
      "type": "date"
    },
    "@version": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "docu": {
      "properties": {
        "session": {
          "properties": {
            "client_host": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "client_lib_ver": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "db_session_id": {
              "type": "text"
            },
            "dormancy_status": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "last_used": {
              "type": "date",
              "format": "dd/MM/YYYY HH:mm:ss"
            },
            "pid": {
              "type": "text"
            },
            "root_pid": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "root_start": {
              "type": "date",
              "format": "dd/MM/YYYY HH:mm:ss"
            },
            "session": {
              "type": "long"
            },
            "session_status": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "shutdown_flag": {
              "type": "text"
            },
            "start": {
              "type": "date",
              "format": "dd/MM/YYYY HH:mm:ss"
            },
            "transaction_status": {
              "type": "text"
            },
            "user_authentication": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "user_name": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      }
    },
    "host": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "message": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "path": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    },
    "tags": {
      "type": "text",
      "fields": {
        "keyword": {
          "type": "keyword",
          "ignore_above": 256
        }
      }
    }
  }
}
  }
}

```

The creating response is:

```
{
  "acknowledged": true
}

```

But when i'm trying to verify this template, it's seems not to be created properly:

```
{
  "documentum": {
    "order": 0,
    "version": 1,
    "index_patterns": [
      "docu_*"
    ],
    "settings": {
      "index": {
        "refresh_interval": "5s"
      }
    },
    "mappings": {},
    "aliases": {}
  }
}

```

do you know why.?

Many thanks for your feed back

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [August 7, 2018, 8:57am UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/2 "2018-08-07T08:57:16Z")

</div>

Since your question is unrelated to Logstash I suggest you edit your post and move it to the Elasticsearch category.

---

<div class="post-metadata">

### Author: ![Loudone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loudone/32/33365_2.png) [@Loudone](https://discuss.elastic.co/u/Loudone)
#### Post date: [August 7, 2018, 9:29am UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/3 "2018-08-07T09:29:13Z")

</div>

@magnusbaeck, Ok it's done

Thank you

---

<div class="post-metadata">

### Author: ![Loudone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loudone/32/33365_2.png) [@Loudone](https://discuss.elastic.co/u/Loudone)
#### Post date: [August 7, 2018, 11:35am UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/4 "2018-08-07T11:35:48Z")

</div>

Does someone have an idea?

---

<div class="post-metadata">

### Author: ![Manikandan622](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@Manikandan622](https://discuss.elastic.co/u/Manikandan622)
#### Post date: [August 7, 2018, 12:38pm UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/5 "2018-08-07T12:38:52Z")

</div>

Index created successfully when I tried with **PUT /sample** instead of **PUT \_template/documentum**  
Verified with below query to confirm index created or not.  
GET /\_cat/indices?v  
Index has been created with name sample.

---

<div class="post-metadata">

### Author: ![Arpit\_Gulati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arpit_gulati/32/48349_2.png) [@Arpit\_Gulati](https://discuss.elastic.co/u/Arpit_Gulati)
#### Post date: [August 7, 2018, 12:44pm UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/6 "2018-08-07T12:44:08Z")

</div>

when doing changes in template file , run curl -XPUT [http://elasticsearchip:9200/\_template/\*?pretty](http://elasticsearchip:9200/_template/*?pretty) -d @elasticsearch-template.json and restart the logtsah and create a new index . After creating the new index, you will see your changes.

---

<div class="post-metadata">

### Author: ![Loudone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loudone/32/33365_2.png) [@Loudone](https://discuss.elastic.co/u/Loudone)
#### Post date: [August 8, 2018, 7:21am UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/7 "2018-08-08T07:21:01Z")

</div>

@Arpit_Gulati, it works fine

Thank you

---

<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: [September 5, 2018, 7:21am UTC](https://discuss.elastic.co/t/problem-with-creating-mapping-template/143274/8 "2018-09-05T07:21:01Z")

</div>

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