From c304fac16d37155b57ed48d8e8bed262847f91f1 Mon Sep 17 00:00:00 2001 From: Nicholas Hassan Date: Sat, 20 Jan 2024 13:03:35 +1030 Subject: [PATCH] in_systemd: fix no journal data when reading from tail 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 --- plugins/in_systemd/systemd_config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/in_systemd/systemd_config.c b/plugins/in_systemd/systemd_config.c index e21610f3e93..87f77b79945 100644 --- a/plugins/in_systemd/systemd_config.c +++ b/plugins/in_systemd/systemd_config.c @@ -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); }