Creating Custom DCR to exclude logging of certain EventID

Hardavinder Bhinder 20 Reputation points
2025-03-31T08:25:34.28+00:00

Hi I am trying to create a DCR rule for Windows Security Events via AMA data connector to exclude certain Event IDs and services using a XPath query. I have tried the following queries but it does not work:

Security!*[System[(EventID != 4624)]]

Security!*[System[not(EventID=4624)]]

Could you please provide any suggestions on how to get this working correctly? Any insights would be greatly appreciated.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 28,186 Reputation points MVP Volunteer Moderator
    2025-03-31T10:46:38.5833333+00:00

    Hi,

    Syntax like

    Security!*[System[(EventID!=4624)]] 
    

    is correct.

    If you already have existing data collection rule edit that rule instead of creating new one. If you create a new one to exclude event ID that is collected via another data collection rule that will not work. Also it depends what kind of configuration you are using for Windows Security events - All, Common or Minimal. If it is Common or Minimal you just need to remove the event ID that you want to exclude in the xPathQuery rather adding value for exclusion. If you use All you will need to add the xPath query to exclude the event.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.