HI
I am tryting to integrate the Sql server data to Elasticsearch with Logstash in my local machine.
I am using the Microsoft Sql Server 2019 and jdbc using the below
--Microsoft JDBC Driver 4.2 for SQL Server
This is my sample config file.
input {
jdbc {
jdbc_driver_library => "C:\Program Files\Microsoft SQL Server\sqljdbc_4.2\enu\jre8\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost;integratedSecurity=true;"
jdbc_data => "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\"
jdbc_log => "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\"
jdbc_Backup => "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup"
jdbc_user => "DESKTOP-2M19H9R\kogan"
#jdbc_password => "pwd"
#servername => "DESKTOP-2M19H9R"
statement => "SELECT * FROM Persons"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "cs_users"
}
}
when i am running this getting the below error. Please help me.
Error: com.microsoft.sqlserver.jdbc.SQLServerDriver not loaded. :jdbc_driver_library is not set, are you sure you included the proper driver client libraries in your classpath?
Exception: LogStash::PluginLoadingError
Stack: C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/plugin_mixins/jdbc/common.rb:36:in load_driver' C:/elastic_stack/logstash-7.8.1/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.5/lib/logstash/inputs/jdbc.rb:275:in
run'
C:/elastic_stack/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:374:in inputworker' C:/elastic_stack/logstash-7.8.1/logstash-core/lib/logstash/java_pipeline.rb:365:in
block in start_input'
[2020-08-18T15:12:15,745][WARN ][logstash.runner ] SIGINT received. Shutting down.
[2020-08-18T15:12:17,922][INFO ][logstash.javapipeline ] Pipeline terminated {"pipeline.id"=>"main"}
[2020-08-18T15:12:18,007][INFO ][logstash.runner ] Logstash shut down.
C:\elastic_stack\logstash-7.8.1>logstash -f sql.conf
Sending Logstash logs to C:/elastic_stack/logstash-7.8.1/logs which is now configured via log4j2.properties
[2020-08-18T15:28:20,147][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2020-08-18T15:28:20,266][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.8.1", "jruby.version"=>"jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0_261-b12 +indy +jit [mswin32-x86_64]"}
[2020-08-18T15:28:21,045][INFO ][logstash.config.source.local.configpathloader] No config files found in path {:path=>"C:/elastic_stack/logstash-7.8.1/sql.conf"}
[2020-08-18T15:28:21,072][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.
[2020-08-18T15:28:21,492][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2020-08-18T15:28:26,443][INFO ][logstash.runner ] Logstash shut down.