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

@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file, from 0.2.0.
## [5.2.1] - 2017-04-09
- Adds Array and Hash to_json support for non-sprintf syntax
## [5.2.0] - 2017-04-01
- Upgrades HikariCP to latest
- Fixes HikariCP logging integration issues

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