Skip to content

Commit

Permalink
Send entity only when account ID is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihonl committed Oct 30, 2024
1 parent 6097557 commit 99f6615
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/out_cloudwatch_logs/cloudwatch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static int init_put_payload(struct flb_cloudwatch *ctx, struct cw_flush *buf,
}
// If we are missing the service name, the entity will get rejected by the frontend anyway
// so do not emit entity unless service name is filled
if(ctx->add_entity && stream->entity != NULL && stream->entity->key_attributes != NULL && stream->entity->key_attributes->name != NULL) {
if(ctx->add_entity && stream->entity != NULL && stream->entity->key_attributes != NULL && stream->entity->key_attributes->name != NULL && stream->entity->key_attributes->account_id != NULL) {
if (!try_to_write(buf->out_buf, offset, buf->out_buf_size,
"\"entity\":{", 10)) {
goto error;
Expand Down

0 comments on commit 99f6615

Please sign in to comment.