logstash-integration-jdbc 5.1.1 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c88894d9c18905f8b857fb38288708bce49084b62ebbffea3cac41421f33dbb
4
- data.tar.gz: 32eb5bce9ba161d5c500bebe20bbd036ebeb20ba1ee149247fb8b169be790bf9
3
+ metadata.gz: 34dbd968b687896da6407942201421c91970d025814596b7229609493b8bbcdc
4
+ data.tar.gz: a5155f4d11413ae5440c1c3ec4da5215c3cdd6febd4cb6d6376b2a03bdcbad42
5
5
  SHA512:
6
- metadata.gz: 2c36ce3aee724b1ec82ee2ce295fd92485acf8ba97ad5428d0d55263cd72a52a9349a523c7d5b5eb76f057fdbf7e8638bd36a7f27ccf1069fa075b0b03e56717
7
- data.tar.gz: 7441a532d6fbd600239c405220a0efcea6e1eb1aac421287be8b39c2119e907e611f0933e2863aaea3e90e0fb59f095dae9ebbad016fe54563dbcb9808341046
6
+ metadata.gz: dec5e76bf0354e7d46fafcb56725ba581ad31c54d475269faf5562e658f3723426a14011d961d6aedaf6ba921b9a654dbe05b2707bdfad38e6b3ca34f1934b56
7
+ data.tar.gz: 65eb85f0e25e73f2e63de44c3d9e64ad6d834c5af316208acb445efcf1aa8d4443de00f2dcf68e66c90057a46fbddb9c7ff451b80bc46ce03bcf32b43c7a6c4a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 5.1.2
2
+ - Fix `prepared_statement_bind_values` in streaming filter to resolve nested event's fields[#76](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/76)
3
+
1
4
  ## 5.1.1
2
5
  - [DOC] Changed docs to indicate that logstash-jdbc-static requires local_table [#56](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/56). Fixes [#55](https://github.com/logstash-plugins/logstash-integration-jdbc/issues/55).
3
6
 
@@ -26,7 +26,7 @@ module LogStash module PluginMixins module JdbcStreaming
26
26
  return InterpolatedParameter.new(given_value)
27
27
  end
28
28
 
29
- if given_value =~ /\A\s*\[[^\]]+\]\s*\z/
29
+ if given_value =~ /\A(\s*\[[^\]]+\]\s*)*\z/
30
30
  return FieldParameter.new(given_value)
31
31
  end
32
32
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-integration-jdbc'
3
- s.version = '5.1.1'
3
+ s.version = '5.1.2'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Integration with JDBC - input and filter plugins"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+ require "logstash/devutils/rspec/spec_helper"
3
+ require "logstash/plugin_mixins/jdbc_streaming/parameter_handler"
4
+
5
+
6
+ describe LogStash::PluginMixins::JdbcStreaming::ParameterHandler do
7
+ context "resolve field reference" do
8
+ let(:event) { ::LogStash::Event.new("field" => "field_value") }
9
+
10
+ it "should resolve root field" do
11
+ handler = LogStash::PluginMixins::JdbcStreaming::ParameterHandler.build_bind_value_handler "[field]"
12
+ handler.extract_from(event)
13
+ expect(handler.extract_from(event)).to eq "field_value"
14
+ end
15
+
16
+ it "should resolve nested field" do
17
+ event = ::LogStash::Event.from_json("{\"field\": {\"nested\": \"nested_field\"}}").first
18
+ handler = LogStash::PluginMixins::JdbcStreaming::ParameterHandler.build_bind_value_handler "[field][nested]"
19
+ handler.extract_from(event)
20
+ expect(handler.extract_from(event)).to eq "nested_field"
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-integration-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -292,6 +292,7 @@ files:
292
292
  - spec/helpers/derbyrun.jar
293
293
  - spec/inputs/integration/integ_spec.rb
294
294
  - spec/inputs/jdbc_spec.rb
295
+ - spec/plugin_mixins/jdbc_streaming/parameter_handler_spec.rb
295
296
  - vendor/jar-dependencies/org/apache/derby/derby/10.14.1.0/derby-10.14.1.0.jar
296
297
  - vendor/jar-dependencies/org/apache/derby/derbyclient/10.14.1.0/derbyclient-10.14.1.0.jar
297
298
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
@@ -344,3 +345,4 @@ test_files:
344
345
  - spec/helpers/derbyrun.jar
345
346
  - spec/inputs/integration/integ_spec.rb
346
347
  - spec/inputs/jdbc_spec.rb
348
+ - spec/plugin_mixins/jdbc_streaming/parameter_handler_spec.rb