Skip to content

Commit c01345c

Browse files
committed
Ensure notify expressions get queried
1 parent 1a9409d commit c01345c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

IPBanCore/Windows/IPBanWindowsEventViewer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,12 @@ private string GetEventLogQueryString(List<string> ignored)
353353
StringBuilder queryString = new("<QueryList>");
354354
int id = 0;
355355
HashSet<string> logNames = new(System.Diagnostics.Eventing.Reader.EventLogSession.GlobalSession.GetLogNames());
356-
foreach (EventViewerExpressionGroup group in service.Config.WindowsEventViewerExpressionsToBlock.Groups)
356+
IEnumerable<EventViewerExpressionGroup> groups = service.Config.WindowsEventViewerExpressionsToBlock.Groups;
357+
if (service.Config.WindowsEventViewerExpressionsToNotify?.Groups is not null)
358+
{
359+
groups = groups.Concat(service.Config.WindowsEventViewerExpressionsToNotify.Groups);
360+
}
361+
foreach (EventViewerExpressionGroup group in groups)
357362
{
358363
if (!logNames.Contains(group.Path) ||
359364
(Environment.OSVersion.Version.Major < group.MinimumWindowsMajorVersion ||

0 commit comments

Comments
 (0)