Skip to content
This repository was archived by the owner on Sep 17, 2019. It is now read-only.

Commit d30f70d

Browse files
author
seko0716
committed
logstash 6.3.2
1 parent 1920ca3 commit d30f70d

File tree

8 files changed

+39
-43
lines changed

8 files changed

+39
-43
lines changed

.gitignore

-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,4 @@
22
Gemfile.lock
33
Gemfile.bak
44
.bundle
5-
.vagrant
6-
.mvn
7-
vendor
8-
lib/**/*.jar
95

10-
.DS_Store
11-
*.swp
12-
*.log

Gemfile

+9
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
source 'https://rubygems.org'
2+
23
gemspec
4+
5+
logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6+
use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7+
8+
if Dir.exist?(logstash_path) && use_logstash_source
9+
gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10+
gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11+
end

lib/logstash/outputs/jdbc.rb

+19-19
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
1919
STRFTIME_FMT = '%Y-%m-%d %T.%L'.freeze
2020

2121
RETRYABLE_SQLSTATE_CLASSES = [
22-
# Classes of retryable SQLSTATE codes
23-
# Not all in the class will be retryable. However, this is the best that
24-
# we've got right now.
25-
# If a custom state code is required, set it in retry_sql_states.
26-
'08', # Connection Exception
27-
'24', # Invalid Cursor State (Maybe retry-able in some circumstances)
28-
'25', # Invalid Transaction State
29-
'40', # Transaction Rollback
30-
'53', # Insufficient Resources
31-
'54', # Program Limit Exceeded (MAYBE)
32-
'55', # Object Not In Prerequisite State
33-
'57', # Operator Intervention
34-
'58', # System Error
22+
# Classes of retryable SQLSTATE codes
23+
# Not all in the class will be retryable. However, this is the best that
24+
# we've got right now.
25+
# If a custom state code is required, set it in retry_sql_states.
26+
'08', # Connection Exception
27+
'24', # Invalid Cursor State (Maybe retry-able in some circumstances)
28+
'25', # Invalid Transaction State
29+
'40', # Transaction Rollback
30+
'53', # Insufficient Resources
31+
'54', # Program Limit Exceeded (MAYBE)
32+
'55', # Object Not In Prerequisite State
33+
'57', # Operator Intervention
34+
'58', # System Error
3535
].freeze
3636

3737
config_name 'jdbc'
@@ -81,7 +81,7 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
8181
# Maximum time between retries, in seconds
8282
config :retry_max_interval, validate: :number, default: 128
8383

84-
# Any additional custom, retryable SQL state codes.
84+
# Any additional custom, retryable SQL state codes.
8585
# Suitable for configuring retryable custom JDBC SQL state codes.
8686
config :retry_sql_states, validate: :array, default: []
8787

@@ -100,10 +100,10 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
100100
config :max_repeat_exceptions, obsolete: 'This has been replaced by max_flush_exceptions - which behaves slightly differently. Please check the documentation.'
101101
config :max_repeat_exceptions_time, obsolete: 'This is no longer required'
102102
config :idle_flush_time, obsolete: 'No longer necessary under Logstash v5'
103-
103+
104104
# Allows the whole event to be converted to JSON
105105
config :enable_event_as_json_keyword, validate: :boolean, default: false
106-
106+
107107
# The magic key used to convert the whole event to JSON. If you need this, and you have the default in your events, you can use this to change your magic keyword.
108108
config :event_as_json_keyword, validate: :string, default: '@event'
109109

@@ -217,7 +217,7 @@ def submit(events)
217217
events.each do |event|
218218
begin
219219
statement = connection.prepareStatement(
220-
(@unsafe_statement == true) ? event.sprintf(@statement[0]) : @statement[0]
220+
(@unsafe_statement == true) ? event.sprintf(@statement[0]) : @statement[0]
221221
)
222222
statement = add_statement_event_params(statement, event) if @statement.length > 1
223223
statement.execute
@@ -326,8 +326,8 @@ def retry_exception?(exception, event)
326326

327327
def log_jdbc_exception(exception, retrying, event)
328328
current_exception = exception
329-
log_text = 'JDBC - Exception. ' + (retrying ? 'Retrying' : 'Not retrying')
330-
329+
log_text = 'JDBC - Exception. ' + (retrying ? 'Retrying' : 'Not retrying')
330+
331331
log_method = (retrying ? 'warn' : 'error')
332332

333333
loop do

logstash-output-jdbc.gemspec

+11-17
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,29 @@ Gem::Specification.new do |s|
44
s.licenses = ['Apache License (2.0)']
55
s.summary = 'This plugin allows you to output to SQL, via JDBC'
66
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 'logstash-output-jdbc'. This gem is not a stand-alone program"
7-
s.authors = ['the_angry_angel']
8-
s.email = '[email protected]'
9-
s.homepage = 'https://github.com/theangryangel/logstash-output-jdbc'
10-
s.require_paths = ['lib']
11-
12-
# Java only
13-
s.platform = 'java'
7+
s.authors = ["the_angry_angel"]
8+
s.email = "[email protected]"
9+
s.homepage = "https://github.com/theangryangel/logstash-output-jdbc"
10+
s.require_paths = ["lib", "vendor"]
1411

1512
# Files
16-
s.files = Dir.glob('{lib,spec}/**/*.rb') + Dir.glob('vendor/**/*') + %w(LICENSE.txt README.md)
17-
18-
# Tests
13+
s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14+
# Tests
1915
s.test_files = s.files.grep(%r{^(test|spec|features)/})
2016

2117
# Special flag to let us know this is actually a logstash plugin
22-
s.metadata = { 'logstash_plugin' => 'true', 'logstash_group' => 'output' }
18+
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
2319

2420
# Gem dependencies
25-
s.add_runtime_dependency 'logstash-core-plugin-api', '~> 2'
26-
s.add_runtime_dependency 'stud'
27-
s.add_runtime_dependency 'logstash-codec-plain'
21+
#
22+
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
23+
s.add_runtime_dependency "logstash-codec-plain"
24+
s.add_development_dependency 'logstash-devutils'
2825

2926
s.requirements << "jar 'com.zaxxer:HikariCP', '2.7.2'"
3027
s.requirements << "jar 'org.apache.logging.log4j:log4j-slf4j-impl', '2.6.2'"
3128

3229
s.add_development_dependency 'jar-dependencies'
3330
s.add_development_dependency 'ruby-maven', '~> 3.3'
34-
35-
s.add_development_dependency "logstash-devutils", "~> 1.3", ">= 1.3.1"
36-
3731
s.add_development_dependency 'rubocop', '0.41.2'
3832
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)