lib/fluent/plugin/out_indicative.rb in fluent-plugin-indicative-0.1.1 vs lib/fluent/plugin/out_indicative.rb in fluent-plugin-indicative-0.1.2
- old
+ new
@@ -9,11 +9,11 @@
hash.each_with_object({}) do |(k, v), h|
if v.is_a? Hash
flatten_hash(v).map do |h_k, h_v|
h["#{k}.#{h_k}"] = h_v
end
- else
+ elsif !v.is_a? Array
h[k] = v
end
end
end
@@ -52,10 +52,10 @@
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = payload.to_json
response = http.request(request)
- if response.code != 200
- log.warn("Indicative responded with error: #{response.body} for #{payload.to_json}")
+ if response.code != "200"
+ log.warn("Indicative responded with error (code: #{response.code}): #{payload.to_json} -> #{response.body}")
end
end
end