Fetch data from oracle database using logstash

I'm using following config file:

input {
jdbc {
jdbc_validate_connection => true
jdbc_driver_library => "/app/logstash-5.6.2/lib/ojdbc7.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@localhost:1521/apextest"
jdbc_user => ""
jdbc_password => "
"
statement => "SELECT sysdate from dual"
}
}
output {
stdout { codec => rubydebug }
}

I ran this file, Getting following error:

[2017-10-07T21:42:29,342][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaSql::SQLRecoverableException: Listener refused the connection with the following error:\nORA-12514, TNS:listener does not currently know of service requested in connect descriptor\n "}
[2017-10-07T21:42:29,343][WARN ][logstash.inputs.jdbc ] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseConnectionError: Java::JavaSql::SQLRecoverableException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

}
[2017-10-07T21:42:29,344][WARN ][logstash.inputs.jdbc ] Attempt reconnection.

Could you please tell me what is issue?

This is more of an Oracle question. Logstash is just the messenger here. Have you looked at a description of the ORC-12514 error message, e.g. the one at https://docs.oracle.com/cd/B19306_01/server.102/b14219/net12500.htm?

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