# Final mapping would have more than 1 type: \[\_doc, doc\]

**URL:** <https://discuss.elastic.co/t/final-mapping-would-have-more-than-1-type-doc-doc/184580>\
**Category:** Logstash\
**Created:** [June 6, 2019, 12:18pm UTC](https://discuss.elastic.co/t/final-mapping-would-have-more-than-1-type-doc-doc/184580 "2019-06-06T12:18:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yashwant\_Shettigar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yashwant_shettigar/32/47652_2.png) [@Yashwant\_Shettigar](https://discuss.elastic.co/u/Yashwant_Shettigar)\
**Post date:** [June 6, 2019, 12:18pm UTC](https://discuss.elastic.co/t/final-mapping-would-have-more-than-1-type-doc-doc/184580/1 "2019-06-06T12:18:51Z")

</div>

I am getting below error in my logstash logs:

[2019-06-06T01:06:27,503][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"winlogbeat-2019.05.24", :\_type=\>"doc", :routing=\>nil}, #LogStash::Event:0x4e319ffe], :response=\>{"index"=\>{"\_index"=\>"winlogbeat-2019.05.24", "\_type"=\>"doc", "\_id"=\>"tS8uK2sBel10KW7wWKLs", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Rejecting mapping update to [winlogbeat-2019.05.24] as the final mapping would have more than 1 type: [\_doc, doc]"}}}}  
[2019-06-06T01:06:27,504][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"winlogbeat-2019.05.24", :\_type=\>"doc", :routing=\>nil}, #LogStash::Event:0x3cad446], :response=\>{"index"=\>{"\_index"=\>"winlogbeat-2019.05.24", "\_type"=\>"doc", "\_id"=\>"ti8uK2sBel10KW7wWKLs", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Rejecting mapping update to [winlogbeat-2019.05.24] as the final mapping would have more than 1 type: [\_doc, doc]"}}}}

Below is the output configuration file content:

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
sniffing =\> true  
manage\_template =\> false  
index =\> "%{[@metadata][beat]}-%{+YYYY.MM.dd}"  
document\_type =\> "%{[@metadata][type]}"

```
   }

```

stdout {  
codec =\> rubydebug  
}  
}

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 6, 2019, 1:04pm UTC](https://discuss.elastic.co/t/final-mapping-would-have-more-than-1-type-doc-doc/184580/2 "2019-06-06T13:04:18Z")

</div>

document\_type is being retired. See [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html).

---

<div class="post-metadata">

**Author:** ![Yashwant\_Shettigar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yashwant_shettigar/32/47652_2.png) [@Yashwant\_Shettigar](https://discuss.elastic.co/u/Yashwant_Shettigar)\
**Post date:** [June 6, 2019, 1:52pm UTC](https://discuss.elastic.co/t/final-mapping-would-have-more-than-1-type-doc-doc/184580/3 "2019-06-06T13:52:25Z")

</div>

Can you please help me in replacing the code ? Exactly, what should I replace document\_type with and how ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 6, 2019, 3:14pm UTC](https://discuss.elastic.co/t/final-mapping-would-have-more-than-1-type-doc-doc/184580/4 "2019-06-06T15:14:26Z")

</div>

> [@Yashwant\_Shettigar](#):
>
> Exactly, what should I replace document\_type with and how ?

Just do not use that option.

---

<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 4, 2019, 3:14pm UTC](https://discuss.elastic.co/t/final-mapping-would-have-more-than-1-type-doc-doc/184580/5 "2019-07-04T15:14:28Z")

</div>

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