mirror of
https://github.com/elastic/logstash.git
synced 2025-04-25 07:07:54 -04:00
use non-capturing group in float regex
This commit is contained in:
parent
e59cc99481
commit
7db44419ee
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ class LogStash::Filters::Date < LogStash::Filters::Base
|
||||||
parser = lambda { |date| joda_parser.parseMillis(date) }
|
parser = lambda { |date| joda_parser.parseMillis(date) }
|
||||||
when "UNIX" # unix epoch
|
when "UNIX" # unix epoch
|
||||||
parser = lambda do |date|
|
parser = lambda do |date|
|
||||||
raise "Invalid UNIX epoch value '#{date}'" unless /^\d+(\.\d+)?$/ === date || date.is_a?(Numeric)
|
raise "Invalid UNIX epoch value '#{date}'" unless /^\d+(?:\.\d+)?$/ === date || date.is_a?(Numeric)
|
||||||
(date.to_f * 1000).to_i
|
(date.to_f * 1000).to_i
|
||||||
end
|
end
|
||||||
when "UNIX_MS" # unix epoch in ms
|
when "UNIX_MS" # unix epoch in ms
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue