lib/fluent/plugin/out_splunk_hec.rb in fluent-plugin-splunk-enterprise-0.9.3 vs lib/fluent/plugin/out_splunk_hec.rb in fluent-plugin-splunk-enterprise-0.10.0
- old
+ new
@@ -103,10 +103,12 @@
end
end
def format_event(time, record)
msg = {'event' => record}
- msg['time'] = time if @use_fluentd_time
+ if @use_fluentd_time
+ msg['time'] = time.respond_to?('to_f') ? time.to_f : time
+ end
# metadata
if record[@sourcetype_key]
msg['sourcetype'] = @remove_sourcetype_key ? record.delete(@sourcetype_key) : record[@sourcetype_key]
elsif @default_sourcetype