Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Converter handling for full class name=org.jruby.RubyObjectVar3 #38

Open
cjlyons81 opened this issue Nov 23, 2019 · 0 comments
Open

Comments

@cjlyons81
Copy link

Logstash Version: 6.4 hosted on Oracle Linux Server release 6.8
Logstash-filter-jdbc_streaming Version: 1.0.4
MSSQL Driver: sqljdbc_6.0/enu/jre8/sqljdbc42.jar
Database: MSSQL 2017

input {
  jdbc {
    jdbc_driver_library => "/etc/logstash/ancillary/jdbc/drivers/sqljdbc_6.0/enu/jre8/sqljdbc42.jar"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_connection_string => ""
    jdbc_user => ""
    jdbc_password => ""
    statement => ""
    last_run_metadata_path => "/etc/logstash/ancillary/jdbc/.logstash_jdbc_last_run"
    add_field => {
      "[@metadata][elastic]" => "false"
      "[@metadata][sql]" => "true"
      "[@metadata][type]" => "inc"
      "[@metadata][run]" => "full-pipeline"
    }
  }
}
filter {
    jdbc_streaming {
      id => "JDBCSTREAM"
      jdbc_driver_library => "/etc/logstash/ancillary/jdbc/drivers/sqljdbc_6.0/enu/jre8/sqljdbc42.jar"
      jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
      jdbc_connection_string => ""
      jdbc_user => ""
      jdbc_password => ""
      statement => "SP_INCIDENT_BACKLOG_INFERENCE @INCIDENT=:inc, @RUN=:run"
      parameters => { "inc" => "incident_id" "run" => "[@metadata][run]"}
      target => "sql_results"
    }
    split { field => "sql_results" }
    ruby {
      code =>'
        event.get("sql_results").each {|k,v| event.set(k,v)}
        event.remove("sql_results")
        event.remove("@timetamp")
      '
    }
}
output { stdout { codec => rubydebug } }

Wanted to get this logged as an issue so at least others can be aware of it. I have a discussion post going through the issue as well.

Missing Converter handling for full class name=org.jruby.RubyObjectVar3

Lead me to an old discussion topic: https://discuss.elastic.co/t/problem-with-timestamp-and-timezone/148622

Which resulted in an issue being logged for the logstash-input-jdbc plugin:
logstash-plugins/logstash-input-jdbc#302

Which lead me to guyboertje's comment pointing back to the logstash-filter-jdbc_streaming plugin: logstash-plugins/logstash-input-jdbc#302 (comment)

Given the conversation it seemed like this was a type issue, where one of my MSSQL types was not playing well with whatever this internal JRuby class (org.jruby.RubyObjectVar3) is doing. Going through some process of elimination I found the culprit. I had a single date type field being leveraged to remove the time value as it was not needed. All I had to do was cast this date type into our standard datetime2 type and everything was right with the world.

I am not sure if upgrading to a newer version of LS would solve this problem but currently that's not an option for me. Wanted to make sure this issue was documented in case someone else runs into it in the future.

Related POST with all the details: https://discuss.elastic.co/t/logstash-filter-jdbc-streaming-parameter-issue-calling-stored-procedure-mssql/209085/2?u=chris_lyons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant