From b69befc294f3c325dc61007471db519492b61715 Mon Sep 17 00:00:00 2001 From: alexhulbert Date: Tue, 25 Nov 2025 17:54:45 +0900 Subject: [PATCH] Drop empty fluentbit filter events --- bob-common/mkosi.extra/etc/fluent-bit/delay.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bob-common/mkosi.extra/etc/fluent-bit/delay.lua b/bob-common/mkosi.extra/etc/fluent-bit/delay.lua index 822880a..581a7a8 100644 --- a/bob-common/mkosi.extra/etc/fluent-bit/delay.lua +++ b/bob-common/mkosi.extra/etc/fluent-bit/delay.lua @@ -2,7 +2,7 @@ -- Lua script stays in memory for the lifetime of the Fluent Bit process, -- so all local variables persist across filter calls. -local DELAY_SEC = 300 -- Delay (in seconds) before flushing logs +local DELAY_SEC = 30 -- Delay (in seconds) before flushing logs local buckets = {} -- Table to bucket logs by their timestamp (seconds) local earliest_sec = nil -- Tracks the earliest second we have in our buckets table local last_processed_second = nil -- Tracks which second we last ran the flush logic on @@ -26,7 +26,7 @@ function log_delay(tag, ts_table, record) -- 2) Check if we've already processed this second if last_processed_second == now_floor then -- Skip the flush; Return no output - return 2, ts_table, {} + return -1, ts_table, {} end -- 3) Otherwise, do the flush logic once for this second @@ -49,7 +49,7 @@ function log_delay(tag, ts_table, record) -- 4) Return any flushed logs if #to_emit == 0 then - return 2, ts_table, {} + return -1, ts_table, {} else local new_ts = { sec = now_sec, nsec = 0 } return 1, new_ts, to_emit