Skip to content

Commit 09e3780

Browse files
committed
in_tail: Handle only first occurrence for skipped lines
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent 7155725 commit 09e3780

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

plugins/in_tail/tail_file.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,12 +1644,15 @@ int flb_tail_file_chunk(struct flb_tail_file *file)
16441644
}
16451645

16461646
#ifdef FLB_HAVE_METRICS
1647-
cmt_counter_inc(ctx->cmt_long_line_skipped,
1648-
cfl_time_now(), 1,
1649-
(char *[]) { (char *) flb_input_name(ctx->ins) });
1647+
if (file->skip_next == FLB_FALSE) {
1648+
cmt_counter_inc(ctx->cmt_long_line_skipped,
1649+
cfl_time_now(), 1,
1650+
(char *[]) { (char *) flb_input_name(ctx->ins) });
1651+
1652+
/* Old API */
1653+
flb_metrics_sum(FLB_TAIL_METRIC_L_SKIPPED, 1, ctx->ins->metrics);
16501654

1651-
/* Old API */
1652-
flb_metrics_sum(FLB_TAIL_METRIC_L_SKIPPED, 1, ctx->ins->metrics);
1655+
}
16531656
#endif
16541657

16551658
/* Warn the user */

0 commit comments

Comments
 (0)