lib/fluent/plugin/out_solr.rb in fluent-plugin-output-solr-0.4.11 vs lib/fluent/plugin/out_solr.rb in fluent-plugin-output-solr-0.4.12
- old
+ new
@@ -115,29 +115,29 @@
record.merge!({@tag_field => tag})
end
if record.has_key?(@time_field) then
begin
- tmp_time = Time.strptime(record[@time_field], @time_format)
+ tmp_time = Time.strptime(record[@time_field], @time_format).utc
if @millisecond then
- record.merge!({@time_field => '%s.%03dZ' % [tmp_time.utc.strftime('%FT%T'), tmp_time.usec/ 1000.0]})
+ record.merge!({@time_field => '%s.%03dZ' % [tmp_time.strftime('%FT%T'), tmp_time.usec / 1000.0]})
else
- record.merge!({@time_field => tmp_time.utc.strftime('%FT%TZ')})
+ record.merge!({@time_field => tmp_time.strftime('%FT%TZ')})
end
rescue
tmp_time = Time.at(time).utc
if @millisecond then
- record.merge!({@time_field => '%s.%03dZ' % [tmp_time.utc.strftime('%FT%T'), tmp_time.usec/ 1000.0]})
+ record.merge!({@time_field => '%s.%03dZ' % [tmp_time.strftime('%FT%T'), tmp_time.usec / 1000.0]})
else
- record.merge!({@time_field => tmp_time.utc.strftime('%FT%TZ')})
+ record.merge!({@time_field => tmp_time.strftime('%FT%TZ')})
end
end
else
tmp_time = Time.at(time).utc
if @millisecond then
- record.merge!({@time_field => '%s.%03dZ' % [tmp_time.utc.strftime('%FT%T'), tmp_time.usec/ 1000.0]})
+ record.merge!({@time_field => '%s.%03dZ' % [tmp_time.strftime('%FT%T'), tmp_time.usec / 1000.0]})
else
- record.merge!({@time_field => tmp_time.utc.strftime('%FT%TZ')})
+ record.merge!({@time_field => tmp_time.strftime('%FT%TZ')})
end
end
if @ignore_undefined_fields then
record.each_key do |key|