- If no timezone is in the date format, assume localtime and move to UTC time.

This commit is contained in:
Jordan Sissel 2010-05-18 08:10:46 +00:00
parent 6b48e99eaa
commit c1ecbff37c

View file

@ -96,8 +96,15 @@ module LogStash
end
end
time ||= DateTime.now
# Store times in UTC, so subtract
res["@DATE"] = time.strftime("%s").to_i
# Assume local timezone if the date format for this log doesn't
# include a timezone offset
if !@config[:date_format].include?("%Z")
res["@DATE"] -= Time.now.gmtoff
end
return res
end