Skip to content

Commit

Permalink
Fix Google Workspace cursor date parsing (elastic#24668)
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr authored Mar 22, 2021
1 parent a7290fd commit 7964c23
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix netflow module ignoring detect_sequence_reset flag. {issue}24268[24268] {pull}24270[24270]
- Fix default `scope` in `add_nomad_metadata`. {issue}24559[24559]
- Fix Cisco ASA parser for message 722051. {pull}24410[24410]
- Fix `google_workspace` pagination. {pull}[]

*Heartbeat*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ request.transforms:
- set:
target: url.params.startTime
value: "[[.cursor.last_execution_datetime]]"
default: '[[parseDate now (parseDuration "-{{.initial_interval}}")]]'
default: '[[formatDate (now (parseDuration "-{{.initial_interval}}"))]]'
response.split:
target: body.items
split:
Expand All @@ -27,7 +27,7 @@ response.pagination:
value: "[[.last_response.body.nextPageToken]]"
cursor:
last_execution_datetime:
value: "[[now]]"
value: "[[formatDate now]]"

{{ else if eq .input "file" }}
type: log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ request.transforms:
- set:
target: url.params.startTime
value: "[[.cursor.last_execution_datetime]]"
default: '[[parseDate now (parseDuration "-{{.initial_interval}}")]]'
default: '[[formatDate (now (parseDuration "-{{.initial_interval}}"))]]'
response.split:
target: body.items
split:
Expand All @@ -27,7 +27,7 @@ response.pagination:
value: "[[.last_response.body.nextPageToken]]"
cursor:
last_execution_datetime:
value: "[[now]]"
value: "[[formatDate now]]"

{{ else if eq .input "file" }}
type: log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ request.transforms:
- set:
target: url.params.startTime
value: "[[.cursor.last_execution_datetime]]"
default: '[[parseDate now (parseDuration "-{{.initial_interval}}")]]'
default: '[[formatDate (now (parseDuration "-{{.initial_interval}}"))]]'
response.split:
target: body.items
split:
Expand All @@ -27,7 +27,7 @@ response.pagination:
value: "[[.last_response.body.nextPageToken]]"
cursor:
last_execution_datetime:
value: "[[now]]"
value: "[[formatDate now]]"

{{ else if eq .input "file" }}
type: log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ request.transforms:
- set:
target: url.params.startTime
value: "[[.cursor.last_execution_datetime]]"
default: '[[parseDate now (parseDuration "-{{.initial_interval}}")]]'
default: '[[formatDate (now (parseDuration "-{{.initial_interval}}"))]]'
response.split:
target: body.items
split:
Expand All @@ -27,7 +27,7 @@ response.pagination:
value: "[[.last_response.body.nextPageToken]]"
cursor:
last_execution_datetime:
value: "[[now]]"
value: "[[formatDate now]]"

{{ else if eq .input "file" }}
type: log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ request.transforms:
- set:
target: url.params.startTime
value: "[[.cursor.last_execution_datetime]]"
default: '[[parseDate now (parseDuration "-{{.initial_interval}}")]]'
default: '[[formatDate (now (parseDuration "-{{.initial_interval}}"))]]'
response.split:
target: body.items
split:
Expand All @@ -27,7 +27,7 @@ response.pagination:
value: "[[.last_response.body.nextPageToken]]"
cursor:
last_execution_datetime:
value: "[[now]]"
value: "[[formatDate now]]"

{{ else if eq .input "file" }}
type: log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ request.transforms:
- set:
target: url.params.startTime
value: "[[.cursor.last_execution_datetime]]"
default: '[[parseDate now (parseDuration "-{{.initial_interval}}")]]'
default: '[[formatDate (now (parseDuration "-{{.initial_interval}}"))]]'
response.split:
target: body.items
split:
Expand All @@ -27,7 +27,7 @@ response.pagination:
value: "[[.last_response.body.nextPageToken]]"
cursor:
last_execution_datetime:
value: "[[now]]"
value: "[[formatDate now]]"

{{ else if eq .input "file" }}
type: log
Expand Down

0 comments on commit 7964c23

Please sign in to comment.