From 8b2677cb41f84516968b83e89f8a2c02a82ea690 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Tue, 8 Jul 2025 18:56:31 +0900 Subject: [PATCH] in_winevtlog: Launch w/o valid subscription when using ignore_missing_channels parameter When using small amount of log volume but sometimes absent channels, users are forcibly ought to specify with the defenetely existing channels together. This causes glitches of log flow controls. So, we decided to permit absence of valid channel subscriptions when using ignore_missing_channels parameter. This permits to use sometimes absent but low log volume and needed to consume A-to-Z EventLog channels. Signed-off-by: Hiroshi Hatake --- plugins/in_winevtlog/in_winevtlog.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/in_winevtlog/in_winevtlog.c b/plugins/in_winevtlog/in_winevtlog.c index 7b272f9d092..4e3431317ed 100644 --- a/plugins/in_winevtlog/in_winevtlog.c +++ b/plugins/in_winevtlog/in_winevtlog.c @@ -110,10 +110,15 @@ static int in_winevtlog_init(struct flb_input_instance *in, ctx->active_channel = winevtlog_open_all(tmp, ctx); if (!ctx->active_channel) { - flb_plg_error(ctx->ins, "failed to open channels"); - flb_log_event_encoder_destroy(ctx->log_encoder); - flb_free(ctx); - return -1; + if (ctx->ignore_missing_channels) { + flb_plg_debug(ctx->ins, "failed to open and no subscribed channels"); + } + else { + flb_plg_error(ctx->ins, "failed to open and no subscribed channels. Subscribe at least one"); + flb_log_event_encoder_destroy(ctx->log_encoder); + flb_free(ctx); + return -1; + } } /* Initialize SQLite DB (optional) */