This commit is contained in:
Karl Southern
2016-07-07 11:03:14 +01:00
parent b10462dacd
commit da5a3d8be3
2 changed files with 14 additions and 8 deletions

View File

@@ -286,14 +286,15 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
def add_statement_event_params(statement, event)
@statement[1..-1].each_with_index do |i, idx|
value = event[i]
value = if value.nil? and i.to_s =~ /%{/
event.sprintf(i)
else
value
end
if i.is_a? String
value = event[i]
if value.nil? and i =~ /%\{/
value = event.sprintf(i)
end
else
value = i
end
case value
when Time
# See LogStash::Timestamp, below, for the why behind strftime.
@@ -323,6 +324,7 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
statement
end
def log_jdbc_exception(exception, retrying)
current_exception = exception
log_text = 'JDBC - Exception. ' + (retrying ? 'Retrying' : 'Not retrying') + '.'