Hi,
I am running logsstash, elasticsearch, kibana in docker 8.15.0 and cassandra 5.0.
I want to setup logstash input from cassandra with jdbc. I have downloaded jdbc drivers from Cassandra JDBC Driver Download & Connectivity
below is my logstash pipeline conf file
nput {
jdbc {
jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/cassandra-jdbc-driver.jar"
jdbc_driver_class => "com.dbschema.CassandraJdbcDriver"
jdbc_connection_string => "jdbc:cassandra://cassandra:9042/test_qa"
statement => "SELECT * FROM test WHERE date = :sql_last_value"
jdbc_user => "cassandra"
jdbc_page_size => 100
use_column_value => true
tracking_column => "date"
schedule => "* * * * *"
jdbc_validate_connection => true
}
}
output {
stdout {
codec => json_lines
}
elasticsearch {
hosts => ["http://elasticsearch:9200"]
index => "test_qa_%{+YYYY_MM_dd}"
}
}
and getting error
logstash | [2024-09-25T11:23:36,841][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::PluginLoadingError: #<Java::JavaLang::ClassNotFoundException: com.dbschema.CassandraJdbcDriver>. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.11/lib/logstash/plugin_mixins/jdbc/common.rb:46:in load_driver'", "/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.11/lib/logstash/inputs/jdbc.rb:307:in
register'", "/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-mixin-ecs_compatibility_support-1.3.0-java/lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb:48:in register'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:237:in
block in register_plugins'", "org/jruby/RubyArray.java:1981:in each'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:236:in
register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:395:in start_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:320:in
start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:194:in run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:146:in
block in start'"], "pipeline.sources"=>["/usr/share/logstash/pipeline/logstash.conf"], :thread=>"#<Thread:0x4fa0c1e2 /usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
also tried with
and jdbc driver from datastax
and getting error
logstash | [2024-09-25T11:31:45,631][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::PluginLoadingError: #<Java::JavaLang::ClassNotFoundException: org.apache.cassandra.cql.jdbc.CassandraDriver>. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.11/lib/logstash/plugin_mixins/jdbc/common.rb:46:in load_driver'", "/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.11/lib/logstash/inputs/jdbc.rb:307:in
register'", "/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-mixin-ecs_compatibility_support-1.3.0-java/lib/logstash/plugin_mixins/ecs_compatibility_support/target_check.rb:48:in register'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:237:in
block in register_plugins'", "org/jruby/RubyArray.java:1981:in each'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:236:in
register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:395:in start_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:320:in
start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:194:in run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:146:in
block in start'"], "pipeline.sources"=>["/usr/share/logstash/pipeline/logstash.conf"], :thread=>"#<Thread:0x15fee1ca /usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}