Microsoft Defender for Cloud
Cloud and workloads

Use a Custom Data Collection Rule for Defender for Servers Ingestion - Microsoft Defender for Cloud | Microsoft Learn

In brief

The article’s wording, prerequisites, portal navigation, step numbering, and event-log instructions were revised. Guidance for regions, endpoints, platform types, and XPath filters was clarified, and a screenshot was removed.

What Defender admins need to know

Admins can use the revised sequence and clearer instructions when creating custom Data Collection Rules. No required configuration change or deadline is stated.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Use a Custom Data Collection Rule for Defender for Servers ingestionIngestion - Microsoft Defender for Cloud | Microsoft Learn

You can use a custom Data Collection Rule (DCR) to control which Windows Security events are sent to Log Analytics for Defender for Servers. This approach can help reduce ingestion volume by filtering out events you don’don't need.

With a custom DCR, you can:

Prerequisites

Before you create a custom DCR, make sure:ensure that you have:

  • Azure Monitor Agent (AMA) is installed on the machines that send data to Log Analytics.
  • A Log Analytics workspace exists in the same region as the DCR.

Create a DCR

To create a custom DCR in the Azure portal, follow these steps:

  1. Sign intoin to the Azure portal.

  2. Go to ▸ Monitor ▸> Settings ▸> Data Collection Rules ▸, and then select + Create.

  3. Enter a name and a subscription.

  4. Choose or create a resource group.

  5. Select the region. The region must match the region of the Log Analytics workspace(s) you’llworkspaces you send to.

    • Under Platform type, select Windows to collect Windows Security events for the SecurityEvent ingestion benefit.(

    • Choose Linux or All if you also need those logs.)

    • Under Data Collection Endpoint, leave <none> unless you're using a Data Collection Endpoint for Private Link or another advanced network setup.

  6. Select Next : Resources >.

  7. Select + Add resources and choose the relevant resources.

  8. If your environment requires a Data Collection Endpoint (forEndpoint, for example, when using Private Link),Link, select + Create endpoint and create it. Create the endpoint in the same region as the DCR.

  9. Select Next : Collect and deliver >.

  10. Select + Add data source.

  11. For Data source type, select Windows Event Logs and choose Basic or Custom:

    • Basic:

      • Under Security, select Audit success and/or Audit failure to send Windows Security events to the SecurityEvent table.
      • If neededneeded, select Application or System event logs to collect additionalmore events. These events are sentgo to the Event table and are billed as regular ingestion. They aren’t covered by theThe Defender for Servers ingestion benefit.benefit doesn't cover them.
    • Custom:

      • Enter an XPath query underUnder Use XPath queries to filter event logs and limit data collection., enter an XPath query. For example, Security!*[System[(EventID=4624 or EventID=4625 or EventID=4688)]]

        Screenshot of the Add data source window in the Create Data Collection Rule wizard showing Windows Event Logs selected with Basic/Custom options.

    Screenshot of the Add data source window in the Create Data Collection Rule wizard showing Windows Event Logs selected with Basic/Custom options.

  12. Select Add.

  13. Select Next : Destination >.

  14. Select + Add destination.

    Screenshot of the Add data source pane showing the Destination tab, where you click + Add destination.

  15. For Destination type, choose Azure Monitor Logs.

  16. Select at least one Log Analytics workspace in the same region as the DCR.

  17. Select Save.

  18. Select Next : Tags > and add any tags you need for resource organization or cost management.

  19. Select Next : Review + create >.

  20. Select Create to deploy the DCR.

Verify data ingestion

After you deploy the DCR is deployed, allowDCR, wait a few minutes for data to start flowing.

Run the following KQL query in the Log Analytics workspace:

Deploy using Azure Policy

\ No newline at end of file If you manage many subscriptions, use Azure Policy to create and assign DCRs at scale. The Deploy AMA DCR for Security Events collection policy initiative applies security event collection rules acrossfor your environment. \ No newline at end of file \ No newline at end of file