Adds JSON support with non-sprintf syntax

This commit is contained in:
Karl Southern
2017-04-09 09:17:05 +01:00
parent e74d67b477
commit cdd88fe322
2 changed files with 6 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ require 'concurrent'
require 'stud/interval'
require 'java'
require 'logstash-output-jdbc_jars'
require 'json'
# Write events to a SQL engine, using JDBC.
#
@@ -293,6 +294,8 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
statement.setFloat(idx + 1, value)
when String
statement.setString(idx + 1, value)
when Array, Hash
statement.setString(idx + 1, value.to_json)
when true, false
statement.setBoolean(idx + 1, value)
else