diff --git a/CHANGELOG.md b/CHANGELOG.md index edb2996..664ab86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/logstash/outputs/jdbc.rb b/lib/logstash/outputs/jdbc.rb index 8c9cb26..b89173b 100644 --- a/lib/logstash/outputs/jdbc.rb +++ b/lib/logstash/outputs/jdbc.rb @@ -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