Skip to content

Commit a72b13f

Browse files
committed
ml: rule: Flush immediately when truncated
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 5aa2e61 commit a72b13f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/multiline/flb_ml_rule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,11 @@ int flb_ml_rule_process(struct flb_ml_parser *ml_parser,
382382
else {
383383
ret = flb_ml_group_cat(group, buf_data, buf_size);
384384
if (ret == FLB_MULTILINE_TRUNCATED) {
385-
rule = st->rule;
386-
group->rule_to_state = rule;
385+
/* Buffer is full. Flush immediately to send the truncated record. */
386+
flb_ml_flush_stream_group(ml_parser, mst, group, FLB_FALSE);
387+
388+
/* Reset state so no more lines are appended to this record. */
389+
group->rule_to_state = NULL;
387390
return ret;
388391
}
389392
}

0 commit comments

Comments
 (0)