Skip to content

Commit

Permalink
in_kafka: Append logs only for non zero length cases
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Dec 19, 2023
1 parent e032ccf commit ac071a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/in_kafka/in_kafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ static int in_kafka_collect(struct flb_input_instance *ins,
}

if (ret == FLB_EVENT_ENCODER_SUCCESS) {
flb_input_log_append(ins, NULL, 0,
ctx->log_encoder->output_buffer,
ctx->log_encoder->output_length);
if (ctx->log_encoder->output_length > 0) {
flb_input_log_append(ins, NULL, 0,
ctx->log_encoder->output_buffer,
ctx->log_encoder->output_length);
}
ret = 0;
}
else {
Expand Down

0 comments on commit ac071a8

Please sign in to comment.