# You are using a deprecated config setting "document\_type" set in elasticsearch

**URL:** https://discuss.elastic.co/t/you-are-using-a-deprecated-config-setting-document-type-set-in-elasticsearch/184826
**Category:** Logstash
**Created:** [June 8, 2019, 7:02am UTC](https://discuss.elastic.co/t/you-are-using-a-deprecated-config-setting-document-type-set-in-elasticsearch/184826 "2019-06-08T07:02:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![madcon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/madcon/32/47745_2.png) [@madcon](https://discuss.elastic.co/u/madcon)
#### Post date: [June 8, 2019, 7:02am UTC](https://discuss.elastic.co/t/you-are-using-a-deprecated-config-setting-document-type-set-in-elasticsearch/184826/1 "2019-06-08T07:02:23Z")

</div>

Hello All,

Fairly new to ELK stack I did encountered the following warning below during my setup.

/[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. {:name=\>"document\_type", :plugin=\>\<LogStash::Outputs::ElasticSearch bulk\_path=\>"/\_xpack/monitoring/\_bulk?system\_id=logstash&system\_api\_version=6&interval=1s", hosts=\>[[http://localhost:9200](http://localhost:9200)], sniffing=\>false, manage\_template=\>false, id=\>"aa9ca250418a0d4ca15e4f43714f32837666af91a6d80d8f12351a90b6be9d81", document\_type=\>"%{[[@metadata](https://github.com/metadata)][document\_type]}", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_993be7a6-e875-499f-93e7-aa84272d4faa", enable\_metric=\>true, charset=\>"UTF-8"\>, workers=\>1, template\_name=\>"logstash", template\_overwrite=\>false, doc\_as\_upsert=\>false, script\_type=\>"inline", script\_lang=\>"painless", script\_var\_name=\>"event", scripted\_upsert=\>false, retry\_initial\_interval=\>2, retry\_max\_interval=\>64, retry\_on\_conflict=\>1, ilm\_enabled=\>false, ilm\_rollover\_alias=\>"logstash", ilm\_pattern=\>"{now/d}-000001", ilm\_policy=\>"logstash-policy", action=\>"index", ssl\_certificate\_verification=\>true, sniffing\_delay=\>5, timeout=\>60, pool\_max=\>1000, pool\_max\_per\_route=\>100, resurrect\_delay=\>5, validate\_after\_inactivity=\>10000, http\_compression=\>false\>}  
[2019-06-06T14:14:01,621][INFO][logstash.pipeline] Starting pipeline {:pipeline\_id=\>".monitoring-logstash", "pipeline.workers"=\>1, "pipeline.batch.size"=\>2, "pipeline.batch.delay"=\>50}  
[2019-06-06T14:14:01,640][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>, :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}  
[2019-06-06T14:14:01,648][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>"[http://localhost:9200/"}](http://localhost:9200/%22%7D)  
[2019-06-06T14:14:01,656][INFO][logstash.outputs.elasticsearch] ES Output version determined {:es\_version=\>6}  
[2019-06-06T14:14:01,656][WARN][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>6}  
[2019-06-06T14:14:01,680][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[http://localhost:9200](http://localhost:9200)"]}  
[2019-06-06T14:14:01,728][INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>".monitoring-logstash", :thread=\>"#\<Thread:0x1fdf29b6 sleep\>"}  
[2019-06-06T14:14:01,737][INFO][logstash.agent] Pipelines running {:count=\>2, :running\_pipelines=\>[:synlite\_snort, :".monitoring-logstash"], :non\_running\_pipelines=\>}  
[2019-06-06T14:14:02,134][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}/

Please let me know what particular changes do I need to make.

Thanks and cheers!

---

<div class="post-metadata">

### Author: ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)
#### Post date: [June 8, 2019, 8:01am UTC](https://discuss.elastic.co/t/you-are-using-a-deprecated-config-setting-document-type-set-in-elasticsearch/184826/2 "2019-06-08T08:01:34Z")

</div>

Remove document \_type for logstash output config  
Starting version 6, elasticsearch allow only 1 document \_type per index, the default document \_type used is \_doc, so no need to use document \_type in your logstash config

---

<div class="post-metadata">

### Author: ![jmb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jmb/32/14312_2.png) [@jmb](https://discuss.elastic.co/u/jmb)
#### Post date: [June 12, 2019, 2:17pm UTC](https://discuss.elastic.co/t/you-are-using-a-deprecated-config-setting-document-type-set-in-elasticsearch/184826/3 "2019-06-12T14:17:55Z")

</div>

Exept that it _doesn't_ use `_doc` when the `document_type` setting is removed, it uses `doc` - which is inconsistent with the type removal expectations.

---

<div class="post-metadata">

### Author: ![Jurka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurka/32/48346_2.png) [@Jurka](https://discuss.elastic.co/u/Jurka)
#### Post date: [June 19, 2019, 5:50am UTC](https://discuss.elastic.co/t/you-are-using-a-deprecated-config-setting-document-type-set-in-elasticsearch/184826/4 "2019-06-19T05:50:54Z")

</div>

Hei guys,  
I am seeing similar warning in my logs:  
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. {:name=\>"document\_type", :plugin=\>\<LogStash::Outputs::ElasticSearch bulk\_path=\>"/\_monitoring/bulk?system\_id=logstash&system\_api\_version=7&interval=1s"...

The logstash version is 7.1.1. It seems to related to monitoring pipeline as if I disable Xpack monitoring I don't see it at all.  
Also searched in lib for the "document\_type" and found it in these files:  
x-pack/lib/template.cfg.erb  
x-pack/lib/monitoring/inputs/metrics/stats\_event\_factory.rb  
x-pack/lib/monitoring/inputs/metrics/state\_event\_factory.rb

also if I comment out the line _document\_type =\> "%{[@metadata][document\_type]}"_ in the template file it also clears the logs.

Thx.

---

<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 17, 2019, 5:51am UTC](https://discuss.elastic.co/t/you-are-using-a-deprecated-config-setting-document-type-set-in-elasticsearch/184826/5 "2019-07-17T05:51:00Z")

</div>

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