Logstash pipeline MS SQL Server Query

Hi all
I am trying to do SQL Query to SQL Server using JDBC and trying to get some data from SQL Server database.

my logstash pipeline looks:

input {
jdbc    {
    jdbc_validate_connection => true
    jdbc_driver_library => "/opt/sqljdbc41.jar"
    jdbc_driver_class => "jdbc:com.microsoft.jdbc.sqlserver.SQLServerDriver"
    jdbc_connection_string => "microsoft:sqlserver://10.91.18.56:1433;DatabaseName=master"
    jdbc_user => "myDomain\myDBUser"
    jdbc_password => "myPwd"
    statement => "select 1"
    schedule => "*/1 * * * *"
    }
}
  filter {
}
output {
        stdout { codec => rubydebug }
}

Unfortunately, this is constantly failing with the following error:

LogStash::ConfigurationError
Feb 04 13:17:00 syspa-test058  logstash[29964]: 2132     jdbc:com.microsoft.jdbc.sqlserver.SQLServerDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Feb 04 13:17:00 syspa-test058 logstash[29964]: 2132       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:in `open_jdbc_connection'
Feb 04 13:17:00 syspa-test058  logstash[29964]: 2132       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221:in `execute_statement'

I have already tried with the different version of SQL Server JDBC driver which was not helping a lot; https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15

I am having SQL server version 2019.
Any idea what am I doing wrong?
Regards,
Ginu

Hi
Could fix this by using the matching version of jdbc driver /mssql-jdbc-7.4.1.jre8.jar on ES 7.5.1

Regards,
Ginu

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