logstash-plugins / logstash-integration-jdbc

Logstash Integration Plugin for JDBC, including Logstash Input and Filter Plugins
Apache License 2.0
53 stars 54 forks source link

Adds dependency to Derby (without renaming) and also add derbytools dependency #160

Closed andsel closed 8 months ago

andsel commented 8 months ago

Release notes

Fix Derby missed driver classes when built locally for version 10.15.

What does this PR do?

Adds missed Derby jars that contain part of the driver, in particular derbytools jar.

Why is it important/What is the impact to the user?

Permit to the user to effectively use the locally built Derby driver.

Checklist

Author's Checklist

filter { jdbc_static { jdbc_driver_library => "/path/to/mysql-connector-java-8.0.26.jar" jdbc_driver_class => "Java::com.mysql.cj.jdbc.Driver" jdbc_connection_string => "jdbc:mysql://localhost:3306/test_logstash"

jdbc_user => "andrea"
jdbc_password => "password"

loaders => [
  {
    id => "remote-data_log"
    query => "select log_id, event_type from data_log"
    local_table => "data_log"
  }
]

local_db_objects => [
  {
    name => "data_log"
    index_columns => ["log_id"]
    columns => [
      ["log_id", "int"],
      ["event_type", "varchar(255)"]
    ]
  }
]

local_lookups => [
  {
    id => "local-data_log"
    query => "SELECT log_id FROM data_log WHERE event_type = :event_type"
    parameters => {event_type => "[message]"}
    target => "data_log"
  }
]

} }

output { stdout { codec => "rubydebug" } }

5. Verify that it works while fails without this PR.

## Related issues

<!-- Recommended
Link related issues below. Insert the issue link or reference after the word "Closes" if merging this should automatically close it.

- Closes #123
- Relates #123
- Requires #123
- Superseeds #123
-->
- Closes #159 

## Logs

[2024-03-14T17:03:09,983][INFO ][logstash.javapipeline ] Pipeline main is configured with pipeline.ecs_compatibility: v8 setting. All plugins in this pipeline will default to ecs_compatibility => v8 unless explicitly configured otherwise. [2024-03-14T17:03:09,988][INFO ][logstash.filters.jdbcstatic][main] derby.system.home is: /Users/andrea/workspace/logstash_andsel/data/plugins/shared/derby_home [2024-03-14T17:03:10,150][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#, :backtrace=>["/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/sequel-5.78.0/lib/sequel/adapters/jdbc.rb:66:in load_driver'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/basic_database.rb:98:inverify_connection'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/read_write_database.rb:58:in post_create'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/basic_database.rb:33:increate'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc/lookup_processor.rb:36:in initialize'", "org/jruby/RubyClass.java:935:innew'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc_static.rb:207:in prepare_runner'", "/Users/andrea/workspace/logstash_andsel/vendor/bundle/jruby/3.1.0/gems/logstash-integration-jdbc-5.4.8/lib/logstash/filters/jdbc_static.rb:158:inregister'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:75:in register'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:237:inblock in register_plugins'", "org/jruby/RubyArray.java:1983:in each'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:236:inregister_plugins'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:611:in maybe_setup_out_plugins'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:249:instart_workers'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:194:in run'", "/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:146:inblock in start'"], "pipeline.sources"=>["/Users/andrea/workspace/logstash_configs/jdbc/mysql_pipeline_filter.conf"], :thread=>"#<Thread:0x6c547cce /Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:134 run>"} [2024-03-14T17:03:10,151][INFO ][logstash.javapipeline ][main] Pipeline terminated {"pipeline.id"=>"main"} [2024-03-14T17:03:10,166][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create

, action_result: false", :backtrace=>nil} [2024-03-14T17:03:10,170][INFO ][logstash.runner ] Logstash shut down. [2024-03-14T17:03:10,171][FATAL][org.logstash.Logstash ] Logstash stopped processing because of an error: (SystemExit) exit org.jruby.exceptions.SystemExit: (SystemExit) exit at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:912) ~[jruby.jar:?] at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:871) ~[jruby.jar:?] at Users.andrea.workspace.logstash_andsel.lib.bootstrap.environment.
(/Users/andrea/workspace/logstash_andsel/lib/bootstrap/environment.rb:90) ~[?:?]