# Document\_type deprecated elasticsearch output logstash

**URL:** <https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822>\
**Category:** Logstash\
**Created:** [December 21, 2017, 12:44pm UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822 "2017-12-21T12:44:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amouzigh\_Driss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amouzigh_driss/32/25868_2.png) [@Amouzigh\_Driss](https://discuss.elastic.co/u/Amouzigh_Driss)\
**Post date:** [December 21, 2017, 12:44pm UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/1 "2017-12-21T12:44:10Z")

</div>

Hello guys,

I'm using logstash 6.1.0.

The output section is configured for ElasticSearch as following:

output {  
elasticsearch {  
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "Data"  
document\_type =\> "MyType"  
}  
stdout { codec =\> rubydebug }  
}

I see in logstash that document\_type is deprecated.  
When removed, the document type used is doc.  
What should I do in this case. I tried type =\> "MyType" but seems not working

Regards  
Driss

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [December 22, 2017, 1:20am UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/2 "2017-12-22T01:20:25Z")

</div>

Document type is deprecated but not completely removed. It will be removed in the next release.  
There is no issue with your current configuration.  
[https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)

Regards,  
N

---

<div class="post-metadata">

**Author:** ![tatdat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tatdat/32/113160_2.png) [@tatdat](https://discuss.elastic.co/u/tatdat)\
**Post date:** [December 22, 2017, 4:56am UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/3 "2017-12-22T04:56:38Z")

</div>

With \*beat, try this.

```
fields_under_root: true
  fields:
    type: your_type
```

---

<div class="post-metadata">

**Author:** ![Amouzigh\_Driss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amouzigh_driss/32/25868_2.png) [@Amouzigh\_Driss](https://discuss.elastic.co/u/Amouzigh_Driss)\
**Post date:** [December 22, 2017, 5:29pm UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/4 "2017-12-22T17:29:53Z")

</div>

@tatdat : Hello,  
Didn't understand your answer.

---

<div class="post-metadata">

**Author:** ![tatdat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tatdat/32/113160_2.png) [@tatdat](https://discuss.elastic.co/u/tatdat)\
**Post date:** [December 23, 2017, 3:15am UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/5 "2017-12-23T03:15:17Z")

</div>

You can use that config above in beat (filbeat, winlogbeat ....) instead of `document_type => "MyType"`

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 23, 2017, 8:01am UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/6 "2017-12-23T08:01:46Z")

</div>

For any new indices created in Elasticsearch 6.x, only one type is allowed per index, which means that you can not use it to differential different types of data (although you could store the type in a normal field instead and filter on this if needed). I therefore do not see the reason why you need to set the type instead of using the default value 'doc'.

---

<div class="post-metadata">

**Author:** ![Amouzigh\_Driss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amouzigh_driss/32/25868_2.png) [@Amouzigh\_Driss](https://discuss.elastic.co/u/Amouzigh_Driss)\
**Post date:** [December 23, 2017, 8:24pm UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/7 "2017-12-23T20:24:31Z")

</div>

Thank you for you answer Christian.  
I have already loaded some data in ES using DevTools. The type created had a business name.

Also I wanted to have data from Logstash as before without any new changes (it's why i added remove\_fields and document\_type).  
How upward compatibility be satisfied if you remove that field?

---

<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:** [January 20, 2018, 8:24pm UTC](https://discuss.elastic.co/t/document-type-deprecated-elasticsearch-output-logstash/112822/8 "2018-01-20T20:24:59Z")

</div>

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