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

[Azure Logs] Replace foreach+set combo with a script processor #34478

Merged
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 @@ -85,6 +85,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
- [google_workspace] Fix pagination and cursor value update. {pull}34274[34274]
- Fix handling of quoted values in auditd module. {issue}22587[22587] {pull}34069[34069]
- Fixing system tests not returning expected content encoding for azure blob storage input. {pull}34412[34412]
- [Azure Logs] Fix authentication_processing_details parsing in sign-in logs. {issue}34330[34330] {pull}34478[34478]

*Heartbeat*

Expand Down
24 changes: 10 additions & 14 deletions x-pack/filebeat/module/azure/signinlogs/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,16 @@ processors:
field:
- azure.signinlogs.properties.location
ignore_missing: true
- foreach:
field: azure.signinlogs.properties.authentication_processing_details
ignore_missing: true
processor:
set:
field: '_tmp.{{{_ingest._value.key}}}'
copy_from: _ingest._value.value
- set:
if: ctx?._tmp != null
field: azure.signinlogs.properties.authentication_processing_details
copy_from: _tmp
- remove:
field: _tmp
ignore_missing: true
- script:
description: "Turns the authentication_processing_details array elements into key/value pairs. For example, the array element ``{key: 'key1', value: 'value1'}`` becomes ``{key1: 'value1'}``."
lang: painless
source: |
def tmp = [:];
for (item in ctx.azure.signinlogs.properties.authentication_processing_details) {
tmp[item.key] = item.value;
}
ctx.azure.signinlogs.properties.authentication_processing_details = tmp;
if: ctx.azure?.signinlogs?.properties?.authentication_processing_details != null && ctx.azure.signinlogs.properties.authentication_processing_details instanceof List
- set:
field: event.kind
value: event
Expand Down