Azure activity logs capture subscription-level management operations, including resource creation and deletion, policy evaluations, and Azure service health events. To forward activity logs to Dynatrace, configure Diagnostics settings at the subscription scope to route them to the Event Hubs namespace deployed by the ARM template.
Activity logs are global, and not region-specific; a single diagnostic setting per subscription is sufficient regardless of how many regions to which the ARM template has been deployed.
dt-logs-evh.Manually configuring a diagnostic setting per subscription is manageable for small environments, but Azure Policy allows you to automatically enforce activity log forwarding across all subscriptions in a management group.
Microsoft does not provide a built-in Azure Policy definition for streaming activity logs to an Event Hubs. The community-authored policy Configure Azure Activity logs to stream to specified Event Hub v2 (policy ID b2215d7b-25ea-411f-8b04-8c30dc61bad9) from the Azure/Community-Policy repository covers this scenario. Review the policy definition before deploying it in your environment.
Import the community policy definition into your Azure environment. Replace <management-group-id> with your management group ID:
BASE_URL="https://raw.githubusercontent.com/Azure/Community-Policy/main/policyDefinitions/Monitoring/configure-azure-activity-logs-to-stream-to-specified-event-hub-v2"curl -sO "${BASE_URL}/azurepolicy.rules.json"curl -sO "${BASE_URL}/azurepolicy.parameters.json"az policy definition create \--name 'configure-activity-log-to-event-hub' \--display-name 'Configure Azure Activity logs to stream to specified Event Hub v2' \--rules @azurepolicy.rules.json \--params @azurepolicy.parameters.json \--management-group <management-group-id>
Select the imported policy definition and select Assign.
Scope the assignment to the desired Management Group.
Under Parameters, uncheck Only show parameters that need input or review and set the following:
dt-logs-evhSelect Review + create, then Create.
Unlike resource log policies, activity log forwarding does not require a region-specific Event Hubs; a single policy assignment per management group or subscription is sufficient.
Azure resource logs capture control-plane and data-plane operations for individual Azure resources (for example, Azure Key Vault access logs, Azure SQL query logs, Azure Storage operations). To forward these logs to Dynatrace, configure Azure diagnostic settings to route logs to the Event Hubs namespace deployed by the ARM template.
Azure diagnostic setting must be configured for each resource or resource type from which you want to forward logs.
dt-logs-evh.Repeat this for each resource or resource type you want to monitor.
Manually configuring diagnostic settings for each resource is impractical at scale. Azure Policy allows you to automatically enforce diagnostic settings across all resources of a given type in a subscription or management group.
In the Azure Portal, go to Policy > Definitions and search for built-in policies with the pattern Configure diagnostic settings for <service> to Event Hub.
Select the appropriate policy for your resource type (for example, Configure diagnostic settings for Azure Key Vault to Event Hub).
Select Assign.
Scope the assignment to the desired Subscription or Management Group.
Under Parameters, uncheck Only show parameters that need input or review and set the following inputs:
dt-logs-evhSelect Create a remediation task to apply the policy to existing resources immediately.
Select Review + create, and then Create.
Notebooks You can query Azure logs ingested via Dynatrace using
Notebooks and DQL.
Use the dt.da.source attribute to filter for logs ingested through the Azure logs ingest pipeline.
fetch logs| filter dt.da.source == "azure-log-ingest"| sort timestamp desc