logstash-input-jdbc 4.3.3 → 4.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/LICENSE +1 -1
- data/lib/logstash/plugin_mixins/jdbc.rb +25 -18
- data/logstash-input-jdbc.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4182f11b49a8109b280f7c078b547a71b3c7134dc54834b06705f94ba064d216
|
4
|
+
data.tar.gz: 6decb981a1ce99e9aac59da1b0259968db299e348d16c76a83cac07e87a58fa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d9cb81fe24f6f301166f2f8baeaa90f18e43f4d3d7ef0ff9c09516d9edd57a5bf6e4eaa9d3a112af7616b062b39f781384dbc25ee3ef9a20fbc1594e36612ca
|
7
|
+
data.tar.gz: e2b979fdfc781cda71aaa0aa1232f9c25b21e120f89ec07729e3bb41e68a57cd7d6d8c467a6db79bf66a83d2f9f29209d2ed76877fe1595af0ee6e2190649152
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
@@ -103,7 +103,8 @@ module LogStash::PluginMixins::Jdbc
|
|
103
103
|
opts = {
|
104
104
|
:user => @jdbc_user,
|
105
105
|
:password => @jdbc_password.nil? ? nil : @jdbc_password.value,
|
106
|
-
:pool_timeout => @jdbc_pool_timeout
|
106
|
+
:pool_timeout => @jdbc_pool_timeout,
|
107
|
+
:keep_reference => false
|
107
108
|
}.merge(@sequel_opts)
|
108
109
|
retry_attempts = @connection_retry_attempts
|
109
110
|
loop do
|
@@ -232,24 +233,12 @@ module LogStash::PluginMixins::Jdbc
|
|
232
233
|
@tracking_column_warning_sent = false
|
233
234
|
@logger.debug? and @logger.debug("Executing JDBC query", :statement => statement, :parameters => parameters, :count => query.count)
|
234
235
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
if @tracking_column_type=="timestamp" and @use_column_value and sql_last_value.is_a?(DateTime)
|
240
|
-
sql_last_value=Time.parse(sql_last_value.to_s) # Coerce the timestamp to a `Time`
|
241
|
-
end
|
242
|
-
yield extract_values_from(row)
|
243
|
-
end
|
244
|
-
end
|
245
|
-
else
|
246
|
-
query.each do |row|
|
247
|
-
sql_last_value = get_column_value(row) if @use_column_value
|
248
|
-
if @tracking_column_type=="timestamp" and @use_column_value and sql_last_value.is_a?(DateTime)
|
249
|
-
sql_last_value=Time.parse(sql_last_value.to_s) # Coerce the timestamp to a `Time`
|
250
|
-
end
|
251
|
-
yield extract_values_from(row)
|
236
|
+
perform_query(query) do |row|
|
237
|
+
sql_last_value = get_column_value(row) if @use_column_value
|
238
|
+
if @tracking_column_type=="timestamp" and @use_column_value and sql_last_value.is_a?(DateTime)
|
239
|
+
sql_last_value = sql_last_value.to_time # Coerce the timestamp to a `Time`
|
252
240
|
end
|
241
|
+
yield extract_values_from(row)
|
253
242
|
end
|
254
243
|
success = true
|
255
244
|
rescue Sequel::DatabaseConnectionError, Sequel::DatabaseError => e
|
@@ -263,6 +252,24 @@ module LogStash::PluginMixins::Jdbc
|
|
263
252
|
return success
|
264
253
|
end
|
265
254
|
|
255
|
+
# Performs the query, respecting our pagination settings, yielding once per row of data
|
256
|
+
# @param query [Sequel::Dataset]
|
257
|
+
# @yieldparam row [Hash{Symbol=>Object}]
|
258
|
+
private
|
259
|
+
def perform_query(query)
|
260
|
+
if @jdbc_paging_enabled
|
261
|
+
query.each_page(@jdbc_page_size) do |paged_dataset|
|
262
|
+
paged_dataset.each do |row|
|
263
|
+
yield row
|
264
|
+
end
|
265
|
+
end
|
266
|
+
else
|
267
|
+
query.each do |row|
|
268
|
+
yield row
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
266
273
|
public
|
267
274
|
def get_column_value(row)
|
268
275
|
if !row.has_key?(@tracking_column.to_sym)
|
data/logstash-input-jdbc.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-jdbc'
|
3
|
-
s.version = '4.3.
|
3
|
+
s.version = '4.3.4'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "Creates events from JDBC data"
|
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"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-jdbc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|