Logstash input jdbc not working

Hi, I am using logstash jdbc input, but it is throwing this error below.

The given configuration is invalid. Reason: Expected one of #, ", ', } at line 2, column 9 (byte 18) after input {
jdbc { {:level=>:fatal}

Here's my logstash config file.
input {
jdbc { jdbc_driver_class => "com.mysql.jdbc.Driver" jdbc_connection_string => "jdbc:mysql://myurl.com:3306/schema" jdbc_user => "dsdsd" jdbc_password => "hbad3" statement => "SELECT * from xyztable" }
}
output {
elasticsearch { index => "jet" hosts => ["http://bdsdsd.com:9200"] } }

I have downloaded mysql-connector-java-5.1.44 as well. Please look if you find any issue. Thanks

If I copy/paste what you posted above I don't get that error so I suspect you have a garbage character in your config file.

@magnusbaeck Can we do similar stuff for hive as well?

Also, I got above error solved, but now I am getting the error below

LogStash::ConfigurationError: com.mysql.jdbc.Driver not loaded. :jdbc_driver_library is not set, are you sure you included the proper driver client libraries in your classpath?>

Can we do similar stuff for hive as well?

If it has a JDBC driver, sure. I don't think there's a Hive-specific plugin.

LogStash::ConfigurationError: com.mysql.jdbc.Driver not loaded. :jdbc_driver_library is not set, are you sure you included the proper driver client libraries in your classpath?>

As the example in the documentation indicates you should point that option at the location of the JDBC driver.

Location of jdbc driver on the machine where logstash is installed or where we are trying to connect?

Location of jdbc driver on the machine where logstash is installed

Yes.

or where we are trying to connect?

Not sure what you mean.

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