diff --git a/plugins/out_flowcounter/out_flowcounter.c b/plugins/out_flowcounter/out_flowcounter.c index 37965ddb046..0fe0307aa85 100644 --- a/plugins/out_flowcounter/out_flowcounter.c +++ b/plugins/out_flowcounter/out_flowcounter.c @@ -216,6 +216,9 @@ static void out_fcount_flush(struct flb_event_chunk *event_chunk, while ((ret = flb_log_event_decoder_next( &log_decoder, &log_event)) == FLB_EVENT_DECODER_SUCCESS) { + /* bytes consumed in the event stream so far */ + off = log_decoder.offset; + if (ctx->event_based) { flb_time_copy(&tm, &log_event.timestamp); } @@ -225,6 +228,7 @@ static void out_fcount_flush(struct flb_event_chunk *event_chunk, t = tm.tm.tv_sec; if (time_is_valid(t, ctx) == FLB_FALSE) { flb_plg_warn(ctx->ins, "out of range. Skip the record"); + last_off = off; continue; }