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

Cherry-pick #20993 to 7.9: Add support for GMT timezone offset in decode_cef #21060

Merged
merged 1 commit into from
Sep 14, 2020
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
*Filebeat*

- Fix parsing of Elasticsearch node name by `elasticsearch/slowlog` fileset. {pull}14547[14547]
- Add support for GMT timezone offsets in `decode_cef`. {pull}20993[20993]

*Heartbeat*

Expand Down
4 changes: 4 additions & 0 deletions x-pack/filebeat/processors/decode_cef/cef/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ var timeLayouts = []string{
"Jan _2 15:04:05.000 MST",
"Jan _2 15:04:05.000 Z0700",
"Jan _2 15:04:05.000 Z07:00",
"Jan _2 15:04:05.000 GMT-07:00",

// MMM dd HH:mm:sss.SSS
"Jan _2 15:04:05.000",
Expand All @@ -113,6 +114,7 @@ var timeLayouts = []string{
"Jan _2 15:04:05 MST",
"Jan _2 15:04:05 Z0700",
"Jan _2 15:04:05 Z07:00",
"Jan _2 15:04:05 GMT-07:00",

// MMM dd HH:mm:ss
"Jan _2 15:04:05",
Expand All @@ -121,6 +123,7 @@ var timeLayouts = []string{
"Jan _2 2006 15:04:05.000 MST",
"Jan _2 2006 15:04:05.000 Z0700",
"Jan _2 2006 15:04:05.000 Z07:00",
"Jan _2 2006 15:04:05.000 GMT-07:00",

// MMM dd yyyy HH:mm:ss.SSS
"Jan _2 2006 15:04:05.000",
Expand All @@ -129,6 +132,7 @@ var timeLayouts = []string{
"Jan _2 2006 15:04:05 MST",
"Jan _2 2006 15:04:05 Z0700",
"Jan _2 2006 15:04:05 Z07:00",
"Jan _2 2006 15:04:05 GMT-07:00",

// MMM dd yyyy HH:mm:ss
"Jan _2 2006 15:04:05",
Expand Down
4 changes: 4 additions & 0 deletions x-pack/filebeat/processors/decode_cef/cef/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestToTimestamp(t *testing.T) {
"Jun 23 17:37:24.000 +05",
"Jun 23 17:37:24.000 +0500",
"Jun 23 17:37:24.000 +05:00",
"Jun 23 17:37:24.000 GMT+05:00",

// MMM dd HH:mm:sss.SSS
"Jun 23 17:37:24.000",
Expand All @@ -31,6 +32,7 @@ func TestToTimestamp(t *testing.T) {
"Jun 23 17:37:24 +05",
"Jun 23 17:37:24 +0500",
"Jun 23 17:37:24 +05:00",
"Jun 23 17:37:24 GMT+05:00",

// MMM dd HH:mm:ss
"Jun 23 17:37:24",
Expand All @@ -41,6 +43,7 @@ func TestToTimestamp(t *testing.T) {
"Jun 23 2020 17:37:24.000 +05",
"Jun 23 2020 17:37:24.000 +0500",
"Jun 23 2020 17:37:24.000 +05:00",
"Jun 23 2020 17:37:24.000 GMT+05:00",

// MMM dd yyyy HH:mm:ss.SSS
"Jun 23 2020 17:37:24.000",
Expand All @@ -51,6 +54,7 @@ func TestToTimestamp(t *testing.T) {
"Jun 23 2020 17:37:24 +05",
"Jun 23 2020 17:37:24 +0500",
"Jun 23 2020 17:37:24 +05:00",
"Jun 23 2020 17:37:24 GMT+05:00",

// MMM dd yyyy HH:mm:ss
"Jun 23 2020 17:37:24",
Expand Down