Skip to content

Commit 44672f6

Browse files
nokute78edsiper
authored andcommitted
in_tail: skip_empty_line supports CRLF line
Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent ac12a20 commit 44672f6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

plugins/in_tail/tail_file.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,17 @@ static int process_content(struct flb_tail_file *file, size_t *bytes)
479479
* property to revert this behavior if some user is affected by
480480
* this change.
481481
*/
482-
483-
if (len == 0 && ctx->skip_empty_lines) {
484-
data++;
485-
processed_bytes++;
486-
continue;
482+
if (ctx->skip_empty_lines) {
483+
if (len == 0) { /* LF */
484+
data++;
485+
processed_bytes++;
486+
continue;
487+
}
488+
else if (len == 1 && data[0] == '\r') { /* CR LF */
489+
data += 2;
490+
processed_bytes += 2;
491+
continue;
492+
}
487493
}
488494

489495
/* Process '\r\n' */

0 commit comments

Comments
 (0)