# Logstash Sending data into wrong/another document type instead of document on which i have configured it

**URL:** <https://discuss.elastic.co/t/logstash-sending-data-into-wrong-another-document-type-instead-of-document-on-which-i-have-configured-it/63568>\
**Category:** Logstash\
**Created:** [October 21, 2016, 6:40am UTC](https://discuss.elastic.co/t/logstash-sending-data-into-wrong-another-document-type-instead-of-document-on-which-i-have-configured-it/63568 "2016-10-21T06:40:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [October 21, 2016, 6:40am UTC](https://discuss.elastic.co/t/logstash-sending-data-into-wrong-another-document-type-instead-of-document-on-which-i-have-configured-it/63568/1 "2016-10-21T06:40:10Z")

</div>

Hi All,  
I have written filter in logstash and placed them in logstash conf.d directory and i have set same index but different document type for elasticsearch output of each filter.But when I have run query in elasticsearch i found output of 1st doument type is stored in 2nd document [type.It](http://type.It) mixing output .Please provide solution as soon as possible.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 21, 2016, 7:09am UTC](https://discuss.elastic.co/t/logstash-sending-data-into-wrong-another-document-type-instead-of-document-on-which-i-have-configured-it/63568/2 "2016-10-21T07:09:09Z")

</div>

Logstash has a single event pipeline. Just because you split your configuration into multiple files doesn't mean that events generated by inputs in one file only reaches filters and outputs in the same file. If you don't want that you need to add conditionals around your filters and outputs.

This comes up here pretty often. You can find additional details in the archives.

---

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [October 21, 2016, 7:44am UTC](https://discuss.elastic.co/t/logstash-sending-data-into-wrong-another-document-type-instead-of-document-on-which-i-have-configured-it/63568/3 "2016-10-21T07:44:01Z")

</div>

Hi Thanks For Reply,its pretty helpful,  
But I'm using jdbc plugin ,So I have written sql query in input using jdbc and configured its output in elasticsearch with particular document type for all the files. I am not able to figure out that how to put conditional over it for separating output.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 21, 2016, 7:51am UTC](https://discuss.elastic.co/t/logstash-sending-data-into-wrong-another-document-type-instead-of-document-on-which-i-have-configured-it/63568/4 "2016-10-21T07:51:49Z")

</div>

See [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html) for examples.

---

<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 6, 2017, 4:33am UTC](https://discuss.elastic.co/t/logstash-sending-data-into-wrong-another-document-type-instead-of-document-on-which-i-have-configured-it/63568/5 "2017-07-06T04:33:18Z")

</div>


