Skip to content

Commit

Permalink
in_systemd: fix no journal data when reading from tail
Browse files Browse the repository at this point in the history
Adds a cursor step-back to after seeking to journal tail. This is
necessary in order for subsequent journal reads to return data. Fixes
issue #8394.

Signed-off-by: Nicholas Hassan <[email protected]>
  • Loading branch information
Nicholas Hassan committed Jan 20, 2024
1 parent 5dec222 commit d5ef735
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/in_systemd/systemd_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ struct flb_systemd_config *flb_systemd_config_create(struct flb_input_instance *
* up to 4096/25*2 ~= 350 old log messages. See also fluent-bit PR #1565.
*/
ret = sd_journal_next_skip(ctx->j, 350);
sd_journal_previous(ctx->j);
flb_plg_debug(ctx->ins,
"jump to the end of journal and skip %d last entries", ret);
}
Expand Down

0 comments on commit d5ef735

Please sign in to comment.