lib/logstash/plugin_mixins/jdbc.rb in logstash-input-jdbc-3.1.0 vs lib/logstash/plugin_mixins/jdbc.rb in logstash-input-jdbc-4.0.0
- old
+ new
@@ -38,13 +38,10 @@
config :jdbc_user, :validate => :string, :required => true
# JDBC password
config :jdbc_password, :validate => :password
- # JDBC password filename
- config :jdbc_password_filepath, :validate => :path
-
# JDBC enable paging
#
# This will cause a sql statement to be broken up into multiple queries.
# Each query will use limits and offsets to collectively retrieve the full
# result-set. The limit size is set with `jdbc_page_size`.
@@ -261,17 +258,18 @@
Hash[row.map { |k, v| [k.to_s, decorate_value(v)] }]
end
private
def decorate_value(value)
+
if value.is_a?(Time)
# transform it to LogStash::Timestamp as required by LS
LogStash::Timestamp.new(value)
elsif value.is_a?(DateTime)
# Manual timezone conversion detected.
# This is slower, so we put it in as a conditional case.
LogStash::Timestamp.new(Time.parse(value.to_s))
else
- value
+ value # no-op
end
end
end