Skip to content

Commit 4dab85c

Browse files
committed
[Filebeat][AWS] Fix vpcflow pipeline exception: Cannot invoke "Object.getClass()" because "receiver" is null (#24167)
The pipeline failed with an obscure error.message: `Cannot invoke "Object.getClass()" because "receiver" is null` when the ingested message didn't contain `aws.vpcflow.*` fiels. Filebeat generates documents that lack those fields when parsing lines from a .log file (not .json) that doesn't conform to the expected formats. This happened for empty lines in particular. (cherry picked from commit f4b7a25)
1 parent 3f9820b commit 4dab85c

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

CHANGELOG.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
167167
- Fix event.kind for system/syslog pipeline {issue}20365[20365] {pull}20390[20390]
168168
- Fix event.type for zeek/ssl and duplicate event.category for zeek/connection {pull}20696[20696]
169169
- Fix Okta default date formatting. {issue}24018[24018] {pull}24025[24025]
170+
- Fix aws/vpcflow generating errors for empty logs or unidentified formats. {pull}24167[24167]
170171

171172
*Heartbeat*
172173

x-pack/filebeat/module/aws/vpcflow/ingest/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ processors:
119119
ignore_empty_value: true
120120

121121
- set:
122-
if: "ctx.aws.vpcflow.instance_id != '-'"
122+
if: "ctx.aws?.vpcflow?.instance_id != null && ctx.aws.vpcflow.instance_id != '-'"
123123
field: cloud.instance.id
124124
value: "{{aws.vpcflow.instance_id}}"
125125
ignore_empty_value: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Phony unsupported log format.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"cloud.provider": "aws",
4+
"event.category": "network_traffic",
5+
"event.dataset": "aws.vpcflow",
6+
"event.kind": "event",
7+
"event.module": "aws",
8+
"event.original": "Phony unsupported log format.",
9+
"event.type": "flow",
10+
"fileset.name": "vpcflow",
11+
"input.type": "log",
12+
"log.offset": 0,
13+
"service.type": "aws",
14+
"tags": [
15+
"forwarded"
16+
]
17+
}
18+
]

0 commit comments

Comments
 (0)