Skip to content

[AWS] check if event.original exists before copying message field #3682

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

Merged
merged 2 commits into from
Jul 13, 2022
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
5 changes: 5 additions & 0 deletions packages/aws/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.17.2"
changes:
- description: Improve support for event.original field from upstream forwarders.
type: bugfix
link: https://github.com/elastic/integrations/pull/3682
- version: "1.17.1"
changes:
- description: Fix misspelling of Log Stream Prefix variable in manifest for aws-cloudwatch input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- grok:
field: event.original
patterns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ processors:
- rename:
field: message
target_field: event.original
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- set:
if: ctx['@timestamp'] != null
field: event.created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- grok:
field: event.original
patterns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- grok:
field: event.original
# Classic ELB patterns documented in https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ processors:
- rename:
field: message
target_field: event.original
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- json:
field: event.original
target_field: json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- grok:
field: event.original
patterns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- json:
field: event.original
target_field: json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- grok:
field: event.original
patterns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- set:
field: event.type
value: connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ processors:
field: message
target_field: event.original
ignore_missing: true
if: 'ctx.event?.original == null'
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
- remove:
field: message
ignore_missing: true
if: 'ctx.event?.original != null'
description: 'The `message` field is no longer required if the document has an `event.original` field.'
- json:
field: event.original
target_field: json
Expand Down
2 changes: 1 addition & 1 deletion packages/aws/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 1.0.0
name: aws
title: AWS
version: 1.17.1
version: 1.17.2
license: basic
description: Collect logs and metrics from Amazon Web Services with Elastic Agent.
type: integration
Expand Down