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 #24167 to 7.x: [Filebeat][AWS] Fix vpcflow pipeline exception: Cannot invoke "Object.getClass()" because "receiver" is null #24168

Merged
merged 1 commit into from
Feb 23, 2021
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 @@ -245,6 +245,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix Logstash module handling of logstash.log.log_event.action field. {issue}20709[20709]
- aws/s3access dataset was populating event.duration using the wrong unit. {pull}23920[23920]
- Zoom module pipeline failed to ingest some chat_channel events. {pull}23904[23904]
- Fix aws/vpcflow generating errors for empty logs or unidentified formats. {pull}24167[24167]

*Heartbeat*

Expand Down
8 changes: 3 additions & 5 deletions x-pack/filebeat/module/aws/vpcflow/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ processors:
ignore_empty_value: true

- set:
if: "ctx.aws.vpcflow.instance_id != '-'"
if: "ctx.aws?.vpcflow?.instance_id != null && ctx.aws.vpcflow.instance_id != '-'"
field: cloud.instance.id
value: "{{aws.vpcflow.instance_id}}"
ignore_empty_value: true
Expand All @@ -131,11 +131,9 @@ processors:
- script:
lang: painless
ignore_failure: true
if: "ctx.aws?.vpcflow?.tcp_flags != null"
source: |
if (ctx?.aws?.vpcflow?.tcp_flags == null)
return;

if (ctx?.aws?.vpcflow?.tcp_flags_array == null) {
if (ctx.aws.vpcflow.tcp_flags_array == null) {
ArrayList al = new ArrayList();
ctx.aws.vpcflow.put("tcp_flags_array", al);
}
Expand Down
1 change: 1 addition & 0 deletions x-pack/filebeat/module/aws/vpcflow/test/bad.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Phony unsupported log format.
18 changes: 18 additions & 0 deletions x-pack/filebeat/module/aws/vpcflow/test/bad.log-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"cloud.provider": "aws",
"event.category": "network_traffic",
"event.dataset": "aws.vpcflow",
"event.kind": "event",
"event.module": "aws",
"event.original": "Phony unsupported log format.",
"event.type": "flow",
"fileset.name": "vpcflow",
"input.type": "log",
"log.offset": 0,
"service.type": "aws",
"tags": [
"forwarded"
]
}
]