# Elastic search Rejecting mapping update

**URL:** <https://discuss.elastic.co/t/elastic-search-rejecting-mapping-update/124983>\
**Category:** Elasticsearch\
**Created:** [March 21, 2018, 12:37pm UTC](https://discuss.elastic.co/t/elastic-search-rejecting-mapping-update/124983 "2018-03-21T12:37:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sri535](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sri535](https://discuss.elastic.co/u/sri535)\
**Post date:** [March 21, 2018, 12:37pm UTC](https://discuss.elastic.co/t/elastic-search-rejecting-mapping-update/124983/1 "2018-03-21T12:37:51Z")

</div>

> Failed to map in indices
> 
> I have a configuration file and template file in logstash is as below please look into it  
> its done on fresh installation

**1.Conf file**

```auto
 input {
  file {
  path => ["D:/JAEK/Results/Python/MyHVC/MyHVC_*.csv"]
  type => "MSHEALTHCHK"
  start_position => "beginning"
  }
  }
  filter {
  grok {
  match => ["message" ,"%{DATA:ETime},%{NUMBER:OverAllStatus},%{DATA:Env},%{GREEDYDATA:Hostaddress},%{DATA:Port},%{GREEDYDATA:ServiceName},%{NUMBER:DiscoveryCompositeStatus},%{NUMBER:DiskSpaceStatus},%{NUMBER:BinderStatus},%{NUMBER:RefreshScopeStatus},%{NUMBER:ConfigServerStatus},%{NUMBER:HystrixStatus},%{NUMBER:RabbitStatus},%{NUMBER:DBStatus}"]
  }
  date {
  timezone => "UTC"
  match => ["ETime", "YYYY-MM-dd hh:mm:ss.SSSZ", "ISO8601"]
  target => "ETime"
  }
  mutate {
  #strip => ["message"]
  convert =>{
  "OverAllStatus" => "integer"
  "DiscoveryCompositeStatus" => "integer"
  "DiskSpaceStatus" => "integer"
  "BinderStatus" => "integer"
  "RefreshScopeStatus" => "integer"
  "ConfigServerStatus" => "integer"
  "HystrixStatus" => "integer"
  "RabbitStatus" => "integer"
  "DBStatus" => "integer"
  }
  }
  }
  output {
       file {
  	path => "D:\MW\OutPutLogs\Whcr_logfile.txt"
  	}
         elasticsearch {
         hosts => "113.131.136.25:9200"
         index => "mshealthchk-%{+YYYY.MM.dd}"
         template_name => "mshealthchk*"
         template => "D:\MW\logstash\templates\template_MyHvc.json"
         template_overwrite => false      
         manage_template => true
         }
  	 }

```

**2.Template File**

```auto

{
   "template" : "mshealthchk-*",
   "settings" : {
"index.refresh_interval" : "10s"
   },
  "mappings" : {
 "_doc": {
   	    "dynamic_templates" : [
       {
        "message_field" : {
          "path_match" : "message",
          "mapping" : {
          "type" : "keyword", "index" : "not_analyzed", "omit_norms" : true
      },
          "match_mapping_type" : "string" }
  },
   {
	  "integers": {
  "match_mapping_type": "long",
     "mapping": {
       "type": "integer"
     }
   }
    },
   	 {
        "string_fields" : {
      "mapping" : {
        "type" : "text", "index" : "analyzed", "norms": false,
           "fields" : {
              "keyword" : {"type": "keyword", "index" : "not_analyzed", "ignore_above" : 1024}
         }
 },
 "match_mapping_type" : "string",
  "match" : "*"
}
 }
],
"properties" : {  
  "@timestamp" : { "format" : "dateOptionalTime","type" : "date" },
   "@version":{ "type": "keyword" },
"host": { "type": "keyword" },
   "path": { "type": "keyword" },
   "ETime": { "type": "date", "format" : "dateOptionalTime" },
  "OverAllStatus": { "type": "integer" },
   "Env": { "type": "keyword" },
 "Hostaddress": { "type": "keyword" },
  "Port": { "type": "keyword" },
   "DiscoveryCompositeStatus": { "type": "integer" },
  "DiskSpaceStatus": { "type": "integer" },
   "BinderStatus": { "type": "integer" },
   "RefreshScopeStatus": { "type": "integer" },
  "ConfigServerStatus": { "type": "integer" },
  "HystrixStatus": { "type": "integer" },
"RabbitStatus": { "type": "integer" },
 "DBStatus": { "type": "integer" }
 }
 }
 }
 }

```

**Provide logs (if relevant)**:

**1. Elasticsearch Log:**  
` [2018-03-21T04:07:57,372][DEBUG][o.e.a.b.TransportShardBulkAction] [mshealthchk-2018.03.21][3] failed to execute bulk item (index) BulkShardRequest [[mshealthchk-2018.03.21][3]] containing [index {[mshealthchk-2018.03.21][doc][H-Y-SGIBF0v4SOTxfGwf], source[{"@timestamp":"2018-03-21T11:07:53.613Z","path":"D:/JAEK/Results/Python/MyHVC/MyHVC_03212018.csv","DiscoveryCompositeStatus":1,"HystrixStatus":1,"RabbitStatus":1,"RefreshScopeStatus":1,"host":"feessw008","Hostaddress":"abc.com","DiskSpaceStatus":1,"type":"MSHEALTHCHK","OverAllStatus":1,"@version":"1","BinderStatus":1,"ServiceName":"ORDER SERVICE","message":"2018-03-21 07:06:23.355Z,1,qa1,abc.com,11051,ORDER SERVICE,1,1,1,1,1,1,1,1\r","Env":"qa1","ETime":"2018-03-21T07:06:23.355Z","DBStatus":1,"Port":"11051","ConfigServerStatus":1}]}] java.lang.IllegalArgumentException: Rejecting mapping update to [mshealthchk-2018.03.21] as the final mapping would have more than 1 type: [_doc, doc]`

**2. Logstash log:**

` [2018-03-21T04:07:57,379][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"mshealthchk-2018.03.21", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x44a98c70>], :response=>{"index"=>{"_index"=>"mshealthchk-2018.03.21", "_type"=>"doc", "_id"=>"H-Y-SGIBF0v4SOTxfGwf", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [mshealthchk-2018.03.21] as the final mapping would have more than 1 type: [_doc, doc]"}}}}`

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 21, 2018, 1:14pm UTC](https://discuss.elastic.co/t/elastic-search-rejecting-mapping-update/124983/2 "2018-03-21T13:14:23Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

---

<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:** [April 18, 2018, 1:14pm UTC](https://discuss.elastic.co/t/elastic-search-rejecting-mapping-update/124983/3 "2018-04-18T13:14:51Z")

</div>

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