Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1321 add CEST and CET timezone to TZ #1378

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion patterns/grok-patterns
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ISO8601_SECOND (?:%{SECOND}|60)
TIMESTAMP_ISO8601 %{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE}?
DATE %{DATE_US}|%{DATE_EU}
DATESTAMP %{DATE}[- ]%{TIME}
TZ (?:[PMCE][SD]T|UTC)
TZ (?:[PMCE][SD]T|UTC|CEST|CET)
DATESTAMP_RFC822 %{DAY} %{MONTH} %{MONTHDAY} %{YEAR} %{TIME} %{TZ}
DATESTAMP_RFC2822 %{DAY}, %{MONTHDAY} %{MONTH} %{YEAR} %{TIME} %{ISO8601_TIMEZONE}
DATESTAMP_OTHER %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{TZ} %{YEAR}
Expand Down
24 changes: 24 additions & 0 deletions spec/filters/grok.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,4 +500,28 @@
insist { subject["foo"] }.is_a?(String)
end
end


describe "Dates with time zone are correctly interpreted" do
config <<-CONFIG
filter {
grok {
match => [ "message", "%{DATESTAMP_RFC822:stimestamp}" ]
singles => true
}
}
CONFIG
sample "Tue Jan 01 2013 04:51:39 CEST" do
insist { subject["stimestamp"] }== "Tue Jan 01 2013 04:51:39 CEST"
end
sample "Tue Jan 01 2013 04:51:39 CET" do
insist { subject["stimestamp"] }== "Tue Jan 01 2013 04:51:39 CET"
end
sample "Tue Jan 01 2013 04:51:39 UTC" do
insist { subject["stimestamp"] }== "Tue Jan 01 2013 04:51:39 UTC"
end
end



end