# Logstash logstash-jdbc-input queries (mapping and type)

**URL:** <https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224>\
**Category:** Logstash\
**Created:** [July 24, 2015, 9:36am UTC](https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224 "2015-07-24T09:36:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navneet\_Mathpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navneet_mathpal/32/3677_2.png) [@Navneet\_Mathpal](https://discuss.elastic.co/u/Navneet_Mathpal)\
**Post date:** [July 24, 2015, 9:36am UTC](https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224/1 "2015-07-24T09:36:03Z")

</div>

hi ,  
I have some queries about logstash-input-jdbc

1. how to specify the type : lets us suppose I have already a mapping available for index . Lets say type is "mydata". If i talk about csv filter in Logstash it has the feature to specify the type =\> "mycsv", so that data will indexed on that type only. Is is not possible in case of jdbc plugin ?  
by default jdbc-input creates type "logs", if I am explicitly defining the type logs in index first and then trying to index the data using jdbc-input it is not indexing the data instead it is showing some unusual behavior..  
Any idea why ?  
And how to resolve it

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talevy/32/44896_2.png) [@talevy](https://discuss.elastic.co/u/talevy)\
**Post date:** [July 28, 2015, 6:13pm UTC](https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224/2 "2015-07-28T18:13:46Z")

</div>

I agree, it is valuable to set this per input.

I have made the issue and hope to resolve it soon!

> <https://github.com/logstash-plugins/logstash-input-jdbc/issues/33>

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talevy/32/44896_2.png) [@talevy](https://discuss.elastic.co/u/talevy)\
**Post date:** [July 28, 2015, 9:04pm UTC](https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224/3 "2015-07-28T21:04:04Z")

</div>

Actually, my mistake.

a type can be configured by way of configuration parameter

```auto
jdbc {
  ...
  type => "jdbc-my-query"
}

```

---

<div class="post-metadata">

**Author:** ![Navneet\_Mathpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navneet_mathpal/32/3677_2.png) [@Navneet\_Mathpal](https://discuss.elastic.co/u/Navneet_Mathpal)\
**Post date:** [July 29, 2015, 8:44am UTC](https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224/4 "2015-07-29T08:44:52Z")

</div>

@talevy that was my concern that if you put type parameter , it behaviors very differently. Rather than indexing the document into elastic it starts showing them into console .. and one logstash node gets created ...  
Again i have tried the same but same issue  
Have you actually tried it ?

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talevy/32/44896_2.png) [@talevy](https://discuss.elastic.co/u/talevy)\
**Post date:** [July 29, 2015, 8:03pm UTC](https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224/5 "2015-07-29T20:03:05Z")

</div>

I am not completely following how that is happening. mind sharing your configuration?

---

<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, 5:33am UTC](https://discuss.elastic.co/t/logstash-logstash-jdbc-input-queries-mapping-and-type/26224/6 "2017-07-06T05:33:26Z")

</div>


