logstash-integration-jdbc 5.1.4 → 5.1.5

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: 624847dd498ef4c1cabb3623b33d6caae518d482b5e6cdab4d7aa97f79e9a0bf
4
- data.tar.gz: 7fc2d7f3ebb36aa50db73c074c2f3b183f7378089a35d49bf9e581617c765cb7
3
+ metadata.gz: 71904a199b39255cbefb08b1c43a08e0507df8af19be11ae3b57b69519d337f5
4
+ data.tar.gz: 17e4ef460ad1e9d51d0ecada1d94b6d41951a65e65f316e287ad58331f5a4211
5
5
  SHA512:
6
- metadata.gz: d8d468fe9bd6c8d54f2aaffb17088bdc957d104e55c7b456f44afb8a581fe82dd7494ac18b768af575a95d634dc887615035be0f4a3a68261394a20254db47e6
7
- data.tar.gz: b252ac776f43ea2d2a3db414d5e787fc1e8f480aeeaf73f81513ecee8c207851d7d557a9fa7878c1a9db6105891b05056f47ead3d7dddd23f49eedfcdd3a8497
6
+ metadata.gz: 503737f45cfcba0724d533664b14bda25bf9abd0c5de549973857855f00722a666022693d1d22e517b735e6171a06d20cd31e11492c7d60321b3456627eab05f
7
+ data.tar.gz: 78d36bd182723abdc72ebf7809f76b86111d3e8bc4111bb08c5a8363fe88e8fe38c4ab563f1408f60c7b0b491f3802c69a31259e4035e8bebcd4bbfc5e8636d9
data/CHANGELOG.md CHANGED
@@ -1,12 +1,17 @@
1
+ ## 5.1.5
2
+ - Refined ECS support [#82](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/82)
3
+ - Uses shared `target` guidance when ECS compatibility is enabled
4
+ - Uses Logstash's EventFactory instead of instantiating events directly
5
+
1
6
  ## 5.1.4
2
7
  - [DOC] Update filter-jdbc_static doc to describe ECS compatibility [#79](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/79)
3
8
 
4
9
  ## 5.1.3
5
10
  - Improve robustness when handling errors from `sequel` library in jdbc static and streaming
6
- filters[#78](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/78)
11
+ filters [#78](https://github.com/logstash-plugins/logstash-integration-jdbc/pull/78)
7
12
 
8
13
  ## 5.1.2
9
- - 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)
14
+ - 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)
10
15
 
11
16
  ## 5.1.1
12
17
  - [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).
data/NOTICE.TXT ADDED
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2018 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
@@ -4,8 +4,11 @@ require "logstash/namespace"
4
4
  require "logstash/plugin_mixins/jdbc/common"
5
5
  require "logstash/plugin_mixins/jdbc/jdbc"
6
6
  require "logstash/plugin_mixins/ecs_compatibility_support"
7
+ require "logstash/plugin_mixins/ecs_compatibility_support/target_check"
7
8
  require "logstash/plugin_mixins/validator_support/field_reference_validation_adapter"
8
9
 
10
+ require "logstash/plugin_mixins/event_support/event_factory_adapter"
11
+
9
12
  # this require_relative returns early unless the JRuby version is between 9.2.0.0 and 9.2.8.0
10
13
  require_relative "tzinfo_jruby_patch"
11
14
 
@@ -131,8 +134,14 @@ require_relative "tzinfo_jruby_patch"
131
134
  module LogStash module Inputs class Jdbc < LogStash::Inputs::Base
132
135
  include LogStash::PluginMixins::Jdbc::Common
133
136
  include LogStash::PluginMixins::Jdbc::Jdbc
137
+
134
138
  # adds ecs_compatibility config which could be :disabled or :v1
135
139
  include LogStash::PluginMixins::ECSCompatibilitySupport(:disabled,:v1,:v8 => :v1)
140
+ include LogStash::PluginMixins::ECSCompatibilitySupport::TargetCheck
141
+
142
+ # adds `event_factory` and `targeted_event_factory
143
+ include LogStash::PluginMixins::EventSupport::EventFactoryAdapter
144
+
136
145
  # adds :field_reference validator adapter
137
146
  extend LogStash::PluginMixins::ValidatorSupport::FieldReferenceValidationAdapter
138
147
 
@@ -270,13 +279,6 @@ module LogStash module Inputs class Jdbc < LogStash::Inputs::Base
270
279
  converters[encoding] = converter
271
280
  end
272
281
  end
273
-
274
- # target must be populated if ecs_compatibility is not :disabled
275
- if @target.nil? && ecs_compatibility != :disabled
276
- logger.info('ECS compatibility is enabled but no ``target`` option was specified, it is recommended'\
277
- ' to set the option to avoid potential schema conflicts (if your data is ECS compliant or'\
278
- ' non-conflicting feel free to ignore this message)')
279
- end
280
282
  end # def register
281
283
 
282
284
  # test injection points
@@ -335,12 +337,7 @@ module LogStash module Inputs class Jdbc < LogStash::Inputs::Base
335
337
  ## do the necessary conversions to string elements
336
338
  row = Hash[row.map { |k, v| [k.to_s, convert(k, v)] }]
337
339
  end
338
- if @target
339
- event = LogStash::Event.new
340
- event.set(@target, row)
341
- else
342
- event = LogStash::Event.new(row)
343
- end
340
+ event = targeted_event_factory.new_event(row)
344
341
  decorate(event)
345
342
  queue << event
346
343
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-integration-jdbc'
3
- s.version = '5.1.4'
3
+ s.version = '5.1.5'
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"
@@ -36,8 +36,9 @@ Gem::Specification.new do |s|
36
36
  s.add_runtime_dependency 'tzinfo-data'
37
37
  # 3.5 limitation is required for jdbc-static loading schedule
38
38
  s.add_runtime_dependency 'rufus-scheduler', '< 3.5'
39
- s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.2'
39
+ s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.3'
40
40
  s.add_runtime_dependency "logstash-mixin-validator_support", '~> 1.0'
41
+ s.add_runtime_dependency "logstash-mixin-event_support", '~> 1.0'
41
42
 
42
43
  s.add_development_dependency "childprocess"
43
44
  s.add_development_dependency 'logstash-devutils'
@@ -364,7 +364,7 @@ describe LogStash::Inputs::Jdbc do
364
364
  end
365
365
 
366
366
  it "should log a warn of missed target usage" do
367
- expect(plugin.logger).to receive(:info).once.with(/ECS compatibility is enabled but no .*?target.*? was specified/)
367
+ expect(plugin.logger).to receive(:info).once.with(a_string_including("ECS compatibility is enabled").and(including("target")))
368
368
 
369
369
  plugin.register
370
370
  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.4
4
+ version: 5.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-09 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ dependencies:
147
147
  requirements:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: '1.2'
150
+ version: '1.3'
151
151
  name: logstash-mixin-ecs_compatibility_support
152
152
  prerelease: false
153
153
  type: :runtime
@@ -155,7 +155,7 @@ dependencies:
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '1.2'
158
+ version: '1.3'
159
159
  - !ruby/object:Gem::Dependency
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  requirements:
@@ -170,6 +170,20 @@ dependencies:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
172
  version: '1.0'
173
+ - !ruby/object:Gem::Dependency
174
+ requirement: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - "~>"
177
+ - !ruby/object:Gem::Version
178
+ version: '1.0'
179
+ name: logstash-mixin-event_support
180
+ prerelease: false
181
+ type: :runtime
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '1.0'
173
187
  - !ruby/object:Gem::Dependency
174
188
  requirement: !ruby/object:Gem::Requirement
175
189
  requirements:
@@ -238,6 +252,7 @@ files:
238
252
  - CONTRIBUTORS
239
253
  - Gemfile
240
254
  - LICENSE
255
+ - NOTICE.TXT
241
256
  - README.md
242
257
  - docs/filter-jdbc_static.asciidoc
243
258
  - docs/filter-jdbc_streaming.asciidoc
@@ -318,8 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
318
333
  - !ruby/object:Gem::Version
319
334
  version: '0'
320
335
  requirements: []
321
- rubyforge_project:
322
- rubygems_version: 2.6.13
336
+ rubygems_version: 3.1.6
323
337
  signing_key:
324
338
  specification_version: 4
325
339
  summary: Integration with JDBC - input and filter plugins