# Lumberjack with JDBC configuration

**URL:** <https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485>\
**Category:** Logstash\
**Created:** [August 9, 2017, 5:13pm UTC](https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485 "2017-08-09T17:13:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [August 9, 2017, 5:13pm UTC](https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485/1 "2017-08-09T17:13:51Z")

</div>

Hi,

Need help with a very typical scenario of getting data using JDBC input plugin and sending it using Logstash - Lumberjack(s) plugins to ES  
Version Details: ES/LS/Kibana - 5.4.1

I have a database with 2 tables that i query separately to get some data  
Query 1 - Get Events  
Query 2 - Get Value

The setup is such as way that i have a server running logstash with JDBC input & Lumberjack output (forwarder)  
CLIENT configuration is like

```
input{
jdbc{ ....Query 1}
}
output{
lumberjack { port => 5044
host => IPOFLUMBERJACKSERVER
}

```

Another server receives the data as Lumberjack input an sends it to ES cluster  
SERVER configuration is like

```
input{
lumberjack{
port => 5044
}
output{
elasticsearch {
hosts => [ES_1:port, ES_2:port]
index => events 
 }

```

Now this configuration works absolutely fine if i have one query, I need to know how should i get these 2 queries parsed using single CLIENT configuration and get individual indices for different queries i.e "events" & "value"

---

<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:** [August 9, 2017, 6:51pm UTC](https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485/2 "2017-08-09T18:51:05Z")

</div>

You can e.g. set a field in each jdbc input (use `type` or `add_field`) and reference that field in your output configuration. This is a very common question so you should be able to find details and examples in the archives and/or Stackoverflow. The fact that you're shipping your events with the lumberjack plugins before it reaches the elasticsearch output is immaterial.

---

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [August 10, 2017, 5:36am UTC](https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485/3 "2017-08-10T05:36:03Z")

</div>

Thanks Magnus, I did tried that, the query 1 is started and created the index with all the events,  
But the issue is my second query 2 is still waiting for query 1 to complete, is there a way to have get this sorted.  
I have one database and 2 queries

---

<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:** [August 10, 2017, 5:54am UTC](https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485/4 "2017-08-10T05:54:56Z")

</div>

That's surprising. I was under the impression that each jdbc input ran in its own thread.

---

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [August 10, 2017, 7:26am UTC](https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485/5 "2017-08-10T07:26:28Z")

</div>

Hi Magnus,  
Tried running a schedule with other query (for events ) , seems the query 2 is also indexed in same "value" index but the type is generated as 111,124 etc and not "events"

 ![IMG_1504](https://us1.discourse-cdn.com/elastic/original/3X/0/d/0d0482a3263546ec029ebaff2cf99c96ac76482a.JPG)

---

<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:** [September 7, 2017, 7:26am UTC](https://discuss.elastic.co/t/lumberjack-with-jdbc-configuration/96485/6 "2017-09-07T07:26:43Z")

</div>

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