# Default value of the type field

**URL:** <https://discuss.elastic.co/t/default-value-of-the-type-field/119280>\
**Category:** Logstash\
**Created:** [February 9, 2018, 5:23pm UTC](https://discuss.elastic.co/t/default-value-of-the-type-field/119280 "2018-02-09T17:23:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snuffkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/snuffkin/32/27614_2.png) [@snuffkin](https://discuss.elastic.co/u/snuffkin)\
**Post date:** [February 9, 2018, 5:23pm UTC](https://discuss.elastic.co/t/default-value-of-the-type-field/119280/1 "2018-02-09T17:23:56Z")

</div>

Elasticsearch Reference says "The preferred type name is \_doc".  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#\_schedule\_for\_removal\_of\_mapping\_types](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#_schedule_for_removal_of_mapping_types)

But, logstash-output-elasticsearch sets "doc" to the type field for default.

> <https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/master/lib/logstash/outputs/elasticsearch/common.rb#L207>

Should logstash-output-elasticsearch set "\_doc" to the type field?

---

<div class="post-metadata">

**Author:** ![quentin.legraverend](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin.legraverend/32/66373_2.png) [@quentin.legraverend](https://discuss.elastic.co/u/quentin.legraverend)\
**Post date:** [February 13, 2018, 2:01pm UTC](https://discuss.elastic.co/t/default-value-of-the-type-field/119280/2 "2018-02-13T14:01:14Z")

</div>

Hi snuffkin,

I was about to do the same post when I saw your's. So, same issue here. Why is the default value of "doc" used in logstash-output-elasticsearch ? (source: [https://www.elastic.co/guide/en/logstash/6.2/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-document\_type](https://www.elastic.co/guide/en/logstash/6.2/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-document_type)).

Moreover, that's been a while I removed all the document\_type fields in my logstash configuration files but I still have this warning in my logfiles:

`[2018-02-13T13:32:45,781][WARN][logstash.outputs.elasticsearch] You are using a deprecated config setting "document_type" set in elasticsearch. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. Document types are being deprecated in Elasticsearch 6.0, and removed entirely in 7.0. You should avoid this feature If you have any questions about this, please visit the #logstash channel on freenode irc. blablablabla.....}`

I use a 6.2.0 stack and the pipeline management feature of Kibana. I've absolutely no configuration in /etc/logstash and all the configurations stored in the pipeline management (in Elasticsearch) are "document\_type"-free in Elasticsearch output.

Could we have any answer from the core-devs of Logstash ?

Have a nice day,  
Kuaaaly

---

<div class="post-metadata">

**Author:** ![byoungb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/byoungb/32/27858_2.png) [@byoungb](https://discuss.elastic.co/u/byoungb)\
**Post date:** [February 17, 2018, 4:46am UTC](https://discuss.elastic.co/t/default-value-of-the-type-field/119280/3 "2018-02-17T04:46:40Z")

</div>

Yeah I agree I just wasted way too much time tracking down an mapping type conflict issue caused by me not realizing that logstash was sending "doc" and my template index had defined "\_doc" like there documentation recommended.

---

<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:** [March 17, 2018, 4:47am UTC](https://discuss.elastic.co/t/default-value-of-the-type-field/119280/4 "2018-03-17T04:47:01Z")

</div>

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