# Elasticsearch put mapping not working

**URL:** <https://discuss.elastic.co/t/elasticsearch-put-mapping-not-working/92956>\
**Category:** Elasticsearch\
**Created:** [July 13, 2017, 7:52am UTC](https://discuss.elastic.co/t/elasticsearch-put-mapping-not-working/92956 "2017-07-13T07:52:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh\_Jinturkar](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@Saurabh\_Jinturkar](https://discuss.elastic.co/u/Saurabh_Jinturkar)\
**Post date:** [July 13, 2017, 7:52am UTC](https://discuss.elastic.co/t/elasticsearch-put-mapping-not-working/92956/1 "2017-07-13T07:52:21Z")

</div>

Hi,  
I am trying to stream logs from logstash to elasticsearch. I am using filebeat to send logs to logstash.

I have not defined any index; it is defined automatically (say "test1") when data is pushed for the first time.

Now, I want to create another index ("test2") so that I can manage field data types. For that, I got the mappings for test1. Updated the index name. And did PUT call for test2 with this data. However, it fails with following result:

ubuntu@elasticsearch:~$ curl -XPUT 'localhost:9200/test2?pretty' -H 'Content-Type: application/json' -d'@/tmp/mappings\_test.json'  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "illegal\_argument\_exception",  
"reason" : "unknown setting [index.test2.mappings.log.properties.@timestamp.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"  
}  
],  
"type" : "illegal\_argument\_exception",  
"reason" : "unknown setting [index.test2.mappings.log.properties.@timestamp.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"  
},  
"status" : 400  
}

Following is the excerpt of the json which I am using.  
{  
"test2" : {  
"mappings" : {  
"log" : {  
"properties" : {  
"@timestamp" : {  
"type" : "date"  
},  
"@version" : {  
"type" : "text",  
"fields" : {  
"keyword" : {  
"type" : "keyword",  
"ignore\_above" : 256  
}  
}  
},  
"accept\_date" : {  
"type" : "text",  
"fields" : {  
"keyword" : {  
"type" : "keyword",  
"ignore\_above" : 256  
}  
}  
},  
....

I modified index name only. Rest of the content is same as mapping of test1 index.

Any help is appreciated on how to create this new index by updating types?

---

<div class="post-metadata">

**Author:** ![geekpete](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geekpete/32/20409_2.png) [@geekpete](https://discuss.elastic.co/u/geekpete)\
**Post date:** [July 21, 2017, 6:11am UTC](https://discuss.elastic.co/t/elasticsearch-put-mapping-not-working/92956/2 "2017-07-21T06:11:06Z")

</div>

Hi Saurabh,

The test2 part of the mapping would be omitted from the mappings\_test.json like:

```
PUT /test2/
{
  "mappings": {
    "log": {
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "@version": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "accept_date": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        }
      }
    }
  }
}

```

rather than:

```
{
"test2" : {
"mappings" : {
...

```

Let me know if this works for you.

Thanks.

---

<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:** [August 18, 2017, 6:12am UTC](https://discuss.elastic.co/t/elasticsearch-put-mapping-not-working/92956/3 "2017-08-18T06:12:00Z")

</div>

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