logstash/spec/support/date-http.rb
Colin Surprenant 84d938ebdc replace json parsers with JrJackson and Oj
refactored timestamps with new Timestamp class
closes #1434
2014-06-12 18:09:22 -04:00

18 lines
410 B
Ruby

require "test_utils"
describe "http dates", :if => RUBY_ENGINE == "jruby" do
extend LogStash::RSpec
config <<-'CONFIG'
filter {
date {
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
locale => "en"
}
}
CONFIG
sample("timestamp" => "25/Mar/2013:20:33:56 +0000") do
insist { subject["@timestamp"].time } == Time.iso8601("2013-03-25T20:33:56.000Z")
end
end