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

add CEST and CET timezone to TZ #1321 #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions spec/patterns/core_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,23 @@
require 'logstash/patterns/core'

describe LogStash::Patterns::Core do
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