Logstash jdbc not creating index silently, debug also wrong

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!

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.

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