Creating Data Collection rule for Windows Defender AV event

Bombbe 1,441 Reputation points
2022-12-01T09:06:59.71+00:00

Hello,
I'm using AMA and I would want to collect Windows Defender AV events to Log Analytics but I'm not sure how to do it in Data collection rule.

Those Defender evets are located in following path: Microsoft-Windows-Windows Defender/Operational which means that I should probably do custom rule by using XPath queries because they are not in basic tab.

266097-image.png

Here is example path of the events but how do I insert Select Path="Microsoft-Windows-Windows Defender/Operational" in my DCR? Just doing System!*[System[(Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]] won't get those events,

266017-image.png

<QueryList>  
  <Query Id="0" Path="Microsoft-Windows-Windows Defender/Operational">  
    <Select Path="Microsoft-Windows-Windows Defender/Operational">*[System[(Level=1  or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]</Select>  
  </Query>  
</QueryList>  
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,561 questions
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,506 Reputation points
    2022-12-11T06:25:34.76+00:00

    Hi @Bombbe ,

    As you are trying to get the event logs from Microsoft-Windows-Windows Defender/Operational in AMA, please use the XPath query as shown below (note that the double-quotes are not present with the log path)

    Microsoft-Windows-Windows Defender/Operational!*[System[(Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]

    In Portal, it would look like:
    269291-image.png

    I verified a few minutes back that the events do get collected in LogAnalytics workspace using this Xpath:
    269301-image.png

    Please let me know if you have any questions.

    ---
    Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.


1 additional answer

Sort by: Most helpful
  1. Andrew Blumhardt 9,956 Reputation points Microsoft Employee
    2022-12-01T14:23:26.72+00:00

    I would try "Microsoft-Windows-Windows Defender/Operational"!*

    or

    "Microsoft-Windows-Windows Defender/Operational"!*[System[(Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]


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.