Skip to content

Commit

Permalink
google_workspace: fix string literal syntax in painless scripts (#12068)
Browse files Browse the repository at this point in the history
  • Loading branch information
efd6 authored Dec 13, 2024
1 parent b482f1b commit 6ff6e5f
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 13 deletions.
8 changes: 8 additions & 0 deletions packages/google_workspace/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# newer versions go on top
- version: "2.26.1"
changes:
- description: Fix string literals in painless scripts.
type: bugfix
link: https://github.com/elastic/integrations/pull/12068
- description: Add missing empty fields cleanup to `admin` data stream.
type: bugfix
link: https://github.com/elastic/integrations/pull/12068
- version: "2.26.0"
changes:
- description: Do not remove `event.original` in main ingest pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,13 +795,9 @@
"email": {
"log_search_filter": {
"end_date": "2022-03-07T12:59:59.000Z",
"message_id": "",
"recipient": {
"value": "[email protected]"
},
"sender": {
"value": ""
},
"start_date": "2022-02-27T13:00:00.000Z"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,24 @@ processors:
- google_workspace.admin.END_DATE_TIME
- google_workspace.admin.WHITELISTED_GROUPS
ignore_missing: true
- script:
tag: script_to_drop_null_values
lang: painless
description: Drops null/empty values recursively.
source: |-
boolean drop(Object object) {
if (object == null || object == '') {
return true;
} else if (object instanceof Map) {
((Map) object).values().removeIf(v -> drop(v));
return (((Map) object).size() == 0);
} else if (object instanceof List) {
((List) object).removeIf(v -> drop(v));
return (((List) object).length == 0);
}
return false;
}
drop(ctx);
on_failure:
- set:
field: event.kind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ processors:
- script:
description: Drops null/empty values recursively.
lang: painless
source:
source: |
boolean dropEmptyFields(Object object) {
if (object == null || object == '') {
return true;
Expand Down
2 changes: 1 addition & 1 deletion packages/google_workspace/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: google_workspace
title: Google Workspace
version: "2.26.0"
version: "2.26.1"
source:
license: Elastic-2.0
description: Collect logs from Google Workspace with Elastic Agent.
Expand Down

0 comments on commit 6ff6e5f

Please sign in to comment.