Skip to content

Commit

Permalink
in_winevtlog: Fix ignoring non-existent channel handling
Browse files Browse the repository at this point in the history
With previous implementation, winevtlog plugin does not handle any channels when
ignore_missing_channels parameter is not true.

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Oct 28, 2022
1 parent bb85731 commit 86250fa
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions plugins/in_winevtlog/winevtlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,16 +612,14 @@ struct mk_list *winevtlog_open_all(const char *channels, int read_existing_event
channel = strtok_s(tmp , ",", &state);
while (channel) {
ch = winevtlog_subscribe(channel, read_existing_events, NULL);
if (ignore_missing_channels) {
if (ch) {
mk_list_add(&ch->_head, list);
}
else {
flb_debug("[in_winevtlog] channel '%s' does not exist", channel);
}
if (ch) {
mk_list_add(&ch->_head, list);
}
else {
if (!ch) {
if (ignore_missing_channels) {
flb_debug("[in_winevtlog] channel '%s' does not exist", channel);
}
else {
flb_free(tmp);
winevtlog_close_all(list);
return NULL;
Expand Down

0 comments on commit 86250fa

Please sign in to comment.