# Logstash jdbc not creating index silently, debug also wrong

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-not-creating-index-silently-debug-also-wrong/98263>\
**Category:** Logstash\
**Created:** [August 24, 2017, 4:14pm UTC](https://discuss.elastic.co/t/logstash-jdbc-not-creating-index-silently-debug-also-wrong/98263 "2017-08-24T16:14:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EpiqSty](https://avatars.discourse-cdn.com/v4/letter/e/d2c977/32.png) [@EpiqSty](https://discuss.elastic.co/u/EpiqSty)\
**Post date:** [August 24, 2017, 4:14pm UTC](https://discuss.elastic.co/t/logstash-jdbc-not-creating-index-silently-debug-also-wrong/98263/1 "2017-08-24T16:14:53Z")

</div>

Hello!

I use ELK stack for visualisation data from DB2, and have 2 jdbc inputs and outputs like:

```
input{
    jdbc{
            jdbc_connection_string => "jdbc:db2://db2:50000/db2"
            jdbc_driver_library => "/usr/local/pin/lib/driver-10.5.6.jar"
            jdbc_driver_class => "com.ibm.db2.jcc.DB2Driver"
            statement_filepath => "/etc/logstash/sql/SLA.sql"
            schedule => "*/5 * * * *"
            type => "sla"
    }
    jdbc{
            jdbc_connection_string => "jdbc:db2://db2:50000/db2"
            jdbc_driver_library => "/usr/local/pin/lib/driver-10.5.6.jar"
            jdbc_driver_class => "com.ibm.db2.jcc.DB2Driver"
            statement_filepath => "/etc/logstash/sql/SL.sql"
            schedule => "*/5 * * * *"
            type => "sl"
    }
}
output{
    if [type] == "sla" {
            elasticsearch {
                    "hosts" => ["localhost:9200"]
                    "index" => "sla"
                    "document_type" => "sla"
            }
    }
    if [type] == "sl" {
            elasticsearch {
                    "hosts" => ["localhost:9200"]
                    "index" =>a "sl"
                    "document_type" => "sl"
            }
    }    

```

With SL input all works fine, but for another input - SLA - something is wrong, even Elasticsearch not creating index.

Another problem here with debug mode, if we trying to run logstash in Debug mode we got errors like:

```
17:55:00.191 [Ruby-0-Thread-22: /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:283] WARion: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=AS;, skill, rownumber );JOIN, DRIVER=4.19.26>}
17:55:00.192 [Ruby-0-Thread-22: /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:283] WAR
17:55:00.205 [Ruby-0-Thread-21: /usr/share/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:283] ERR
        times(time);JOIN, DRIVER=4.19.26: SELECT count(*) AS COUNT FROM (WITH
        times(time) as (
[...skipped sql query ...]
 ur
) AS T1 FETCH FIRST ROW ONLY 

```

But if we run without --debug, only with --verbose, all works fine for SL input , but not produce any errors for SLA,  
Could you please advice, how to troubleshoot such issue?

ps: we are using such versions:

```
 apt-cache policy elasticsearch logstash kibana | grep "*"
 *** 5.5.1 1000
 *** 1:5.5.1-1 0
 *** 5.5.2 0

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![EpiqSty](https://avatars.discourse-cdn.com/v4/letter/e/d2c977/32.png) [@EpiqSty](https://discuss.elastic.co/u/EpiqSty)\
**Post date:** [August 25, 2017, 10:18am UTC](https://discuss.elastic.co/t/logstash-jdbc-not-creating-index-silently-debug-also-wrong/98263/2 "2017-08-25T10:18:05Z")

</div>

We have found the issue, one of columns in SQL query has name "type". After changing query all works well.  
But anyway seems something broken in --debug mode. Anybody seen issues with it ? I mean situation , when without --debug all works well, but with --debug we are getting errors.

---

<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 22, 2017, 10:18am UTC](https://discuss.elastic.co/t/logstash-jdbc-not-creating-index-silently-debug-also-wrong/98263/3 "2017-09-22T10:18:38Z")

</div>

Closed on September 22, 2017, 10:18am UTC

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