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 # Change Log
All notable changes to this project will be documented in this file, from 0.2.0. 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 ## [5.2.0] - 2017-04-01
- Upgrades HikariCP to latest - Upgrades HikariCP to latest
- Fixes HikariCP logging integration issues - Fixes HikariCP logging integration issues

View File

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