Hi, I am trying to connect an SQL database with Elasticsearch.
So I have done all the changes in the config file of logstash and created an index in Kibana console.
But I am getting error.
My config file looks like this
input {
jdbc {
jdbc_connection_string => "jdbc:sqlserver://PG01GXXE\MSSQLSERVER01:1433;databaseName=VonageRPA;integratedSecurity=true;user=sa;password="
jdbc_driver_library => "C:\Program Files\sqljdbc_4.2\enu\jre8\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_user => "PG01GXXE\ayantiadmin"
jdbc_password => "pro#123"
statement => "SELECT * FROM WarbaLogs"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "warbalog_sql"
}
}
and when I am running the config file following this command logstash -f sql.conf
I am getting this error.
:non_running_pipelines=>}
[2019-08-22T18:56:36,290][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2019-08-22T18:56:37,266][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: Login failed for user 'PG01GXXE\ayantiadmin'. ClientConnectionId:bd5701ba-5ec6-462b-91da-ddbb8edebe2c"}
[2019-08-22T18:56:37,303][ERROR][logstash.javapipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"PG01GXXE\ayantiadmin", jdbc_password=>, statement=>"SELECT * FROM WarbaLogs", jdbc_driver_library=>"C:\Program Files\Java\sqljdbc_4.2\enu\jre8\sqljdbc42.jar", jdbc_connection_string=>"jdbc:sqlserver://PG01GXXE\MSSQLSERVER01:1433;databaseName=VonageRPA;integratedSecurity=true;user=sa;password=", id=>"cd3dc08b51eae00482df46392e780908624dc52592e9fc29459b5a82c73ffa1a", jdbc_driver_class=>"com.microsoft.sqlserver.jdbc.SQLServerDriver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_f4d44d91-0d92-4b66-be7f-5dab66bfef21", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1970-01-01 00:00:00 UTC}, last_run_metadata_path=>"C:\Users\ayantiadmin/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Login failed for user 'PG01GXXE\ayantiadmin'. ClientConnectionId:bd5701ba-5ec6-462b-91da-ddbb8edebe2c
Exception: Sequel::DatabaseConnectionError
Stack: com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(com/microsoft/sqlserver/jdbc/SQLServerException.java:217)
com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(com/microsoft/sqlserver/jdbc/tdsparser.java:251)
com.microsoft.sqlserver.jdbc.TDSParser.parse(com/microsoft/sqlserver/jdbc/tdsparser.java:81)
com.microsoft.sqlserver.jdbc.SQLServerConnection$1LogonProcessor.complete(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2826)
com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:3082)
com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2361)
com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:44)
com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2347)
com.microsoft.sqlserver.jdbc.TDSCommand.execute(com/microsoft/sqlserver/jdbc/IOBuffer.java:6276)
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1794)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1405)
com.microsoft.sqlserver.jdbc.SQLServerConnection.login(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1069)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:905)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:452)
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(com/microsoft/sqlserver/jdbc/SQLServerDriver.java:1014)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:425)
org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:292)
C_3a_.Users.ayanti_dot_dey.Documents.ELKStack.logstash_minus_7_dot_3_dot_0.logstash_minus_7_dot_3_dot_0.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_22_dot_0.lib.sequel.adapters.jdbc.connect(C:/Users/ayanti.dey/Documents/ELKStack/logstash-7.3.0/logstash-7.3.0/vendor/bundle/jruby/2.5.0/gems/sequel-5.22.0/lib/sequel/adapters/jdbc.rb:221)
C_3a_.Users.ayanti_dot_dey.Documents.ELKStack.logstash_minus_7_dot_3_dot_0.logstash_minus_7_dot_3_dot_0.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_22_dot_0.lib.sequel.adapters.jdbc.RUBY$method$connect$0$VARARGS(C_3a_/Users/ayanti_dot_dey/Documents/ELKStack/logstash_minus_7_dot_3_dot_0/logstash_minus_7_dot_3_dot_0/vendor/bundle/jruby/$2_dot_5_dot_0/gems/sequel_minus_5_dot_22_dot_0/lib/sequel/adapters/C:/Users/ayanti.dey/Documents/ELKStack/logstash-7.3.0/logstash-7.3.0/vendor/bundle/jruby/2.5.0/gems/sequel-5.22.0/lib/sequel/adapters/jdbc.rb)
I have tried almost all the methods but still cant seem to find a way.