How to use parameters in a stored script that's executed using logstash output plugin

I think the parameters option should just be { "key1" => "value1" "key2" => "value2" }. Otherwise the flat_map call will create an array which needs to be encoded.