Skip to content

Commit 3ac496f

Browse files
cosmo0920edsiper
authored andcommitted
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 <[email protected]>
1 parent 06c31d7 commit 3ac496f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

plugins/in_winevtlog/in_winevtlog.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ static int in_winevtlog_init(struct flb_input_instance *in,
237237

238238
ctx->active_channel = winevtlog_open_all(tmp, ctx);
239239
if (!ctx->active_channel) {
240-
flb_plg_error(ctx->ins, "failed to open channels");
241-
flb_log_event_encoder_destroy(ctx->log_encoder);
242-
flb_free(ctx);
243-
return -1;
240+
if (ctx->ignore_missing_channels) {
241+
flb_plg_debug(ctx->ins, "failed to open and no subscribed channels");
242+
}
243+
else {
244+
flb_plg_error(ctx->ins, "failed to open and no subscribed channels. Subscribe at least one");
245+
flb_log_event_encoder_destroy(ctx->log_encoder);
246+
flb_free(ctx);
247+
return -1;
248+
}
244249
}
245250

246251
/* Initialize SQLite DB (optional) */

0 commit comments

Comments
 (0)