mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Merge pull request #213 from ralphm/master
Preserve milliseconds for UNIX timestamps in date filter.
This commit is contained in:
commit
0079aa6cff
1 changed files with 1 additions and 1 deletions
|
@ -93,7 +93,7 @@ class LogStash::Filters::Date < LogStash::Filters::Base
|
||||||
joda_parser = org.joda.time.format.ISODateTimeFormat.dateTimeParser.withOffsetParsed
|
joda_parser = org.joda.time.format.ISODateTimeFormat.dateTimeParser.withOffsetParsed
|
||||||
parser = lambda { |date| joda_parser.parseDateTime(date) }
|
parser = lambda { |date| joda_parser.parseDateTime(date) }
|
||||||
when "UNIX" # unix epoch
|
when "UNIX" # unix epoch
|
||||||
parser = lambda { |date| org.joda.time.Instant.new(date.to_i * 1000).toDateTime }
|
parser = lambda { |date| org.joda.time.Instant.new((date.to_f * 1000).to_i).toDateTime }
|
||||||
when "UNIX_MS" # unix epoch in ms
|
when "UNIX_MS" # unix epoch in ms
|
||||||
parser = lambda { |date| org.joda.time.Instant.new(date.to_i).toDateTime }
|
parser = lambda { |date| org.joda.time.Instant.new(date.to_i).toDateTime }
|
||||||
when "TAI64N" # TAI64 with nanoseconds, -10000 accounts for leap seconds
|
when "TAI64N" # TAI64 with nanoseconds, -10000 accounts for leap seconds
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue