|
| 1 | +--- |
| 2 | +title: Monitoring metrics for Azure Application Gateway Web Application Firewall metrics |
| 3 | +description: This article describes the Azure Application Gateway WAF monitoring metrics. |
| 4 | +services: appgateway |
| 5 | +author: tobystic |
| 6 | +manager: gunjan.jain |
| 7 | +ms.service: web-application-firewall |
| 8 | +ms.topic: how-to |
| 9 | +ms.date: 03/15/2022 |
| 10 | +ms.author: olotolor |
| 11 | +--- |
| 12 | + |
| 13 | +# Azure Web Application Firewall Monitoring and Logging |
| 14 | + |
| 15 | +Azure Web Application Firewall (WAF) monitoring and logging are provided through logging and integration with Azure Monitor and Azure Monitor logs. |
| 16 | + |
| 17 | +## Azure Monitor |
| 18 | + |
| 19 | +WAF with Application Gateway log is integrated with [Azure Monitor](../../azure-monitor/overview.md). Azure Monitor allows you to track diagnostic information including WAF alerts and logs. You can configure WAF monitoring within the Application Gateway resource in the portal under the **Diagnostics** tab or through the Azure Monitor service directly. |
| 20 | + |
| 21 | +## Logs and diagnostics |
| 22 | + |
| 23 | +WAF with Application Gateway provides detailed reporting on each threat it detects. Logging is integrated with Azure Diagnostics logs and alerts are recorded in a json format. These logs can be integrated with [Azure Monitor logs](../../azure-monitor/insights/azure-networking-analytics.md). |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +For additional information on diagnostics log, visit [Application Gateway WAF resource logs](../ag/web-application-firewall-logs.md) |
| 28 | + |
| 29 | + |
| 30 | +## Application Gateway WAF V2 Metrics |
| 31 | + |
| 32 | +New WAF metrics are only available for Core Rule Set 3.2 or greater, or with bot protection and geo-filtering. The metrics can be further filtered on the supported dimensions. |
| 33 | + |
| 34 | +|**Metrics**|**Description**|**Dimension**| |
| 35 | +| :------------------| :-------------------------------------| :-----------------| |
| 36 | +|**WAF Total Requests**|Count of successful requests that WAF engine has served.| Action, Country/Region, Method, Mode| |
| 37 | +|**WAF Managed Rule Matches**|Count of total requests that a managed rule has matched.| Action, Country/Region, Mode, Rule Group, Rule Id | |
| 38 | +|**WAF Custom Rule Matches**|Count of total requests that match a specific custom rule. | Action, Country/Region, Mode, Rule Group, Rule Name| |
| 39 | +|**WAF Bot Protection Matches**|Count of total requests that have been blocked or logged from malicious IP addresses. The IP addresses are sourced from the Microsoft Threat Intelligence feed.| Action, Country/Region, Bot Type, Mode| |
| 40 | + |
| 41 | +For metrics supported by Application Gateway V2 SKU, see [Application Gateway v2 metrics](../../application-gateway/application-gateway-metrics.md#metrics-supported-by-application-gateway-v2-sku) |
| 42 | + |
| 43 | +## Application Gateway WAF V1 Metrics |
| 44 | + |
| 45 | +|**Metrics**|**Description**|**Dimension**| |
| 46 | +| :------------------| :-------------------------------------| :-----------------| |
| 47 | +|**Web Application Firewall Blocked Requests Count**|Count of total requests that have been blocked by the WAF engine|| |
| 48 | +|**Web Application Firewall Blocked Requests Distribution**|Total number of rules hit distribution for the blocked requests by Rule Group and Rule ID|Rule Group, Rule ID| |
| 49 | +|**Web Application Firewall Total Rule Distribution**|Count of total matched requests distribution by Rule Group and Rule ID |Rule Group, Rule ID| |
| 50 | + |
| 51 | +For metrics supported by Application Gateway V1 SKU, see [Application Gateway v1 metrics](../../application-gateway/application-gateway-metrics.md#metrics-supported-by-application-gateway-v1-sku) |
| 52 | + |
| 53 | + |
| 54 | + ## Access WAF Metrics in Azure portal |
| 55 | + |
| 56 | +1. From the Azure portal menu, select **All Resources** >> **\<your-Application-Gateway-profile>**. |
| 57 | + |
| 58 | +2. Under **Monitoring**, select **Metrics**: |
| 59 | + |
| 60 | +3. In **Metrics**, select the metric to add: |
| 61 | + |
| 62 | +:::image type="content" source="../media/waf-appgateway-metrics/appgw-waf-metrics-1.png" alt-text="Screenshot of waf metrics page." lightbox="../media/waf-appgateway-metrics/appgw-waf-metrics-1-expanded.png"::: |
| 63 | + |
| 64 | +4. Select Add filter to add a filter: |
| 65 | + |
| 66 | +:::image type="content" source="../media/waf-appgateway-metrics/appgw-waf-metrics-2.png" alt-text="Screenshot of adding filters to metrics." lightbox="../media/waf-appgateway-metrics/appgw-waf-metrics-2-expanded.png"::: |
| 67 | + |
| 68 | + 5. Select New chart to add a new chart |
| 69 | + |
| 70 | + ## Configure Alerts in Azure portal |
| 71 | + |
| 72 | +1. Set up alerts on Azure Application Gateway by selecting **Monitoring** >> **Alerts**. |
| 73 | + |
| 74 | +1. Select **New alert rule** for metrics listed in Metrics section. |
| 75 | + |
| 76 | +Alert will be charged based on Azure Monitor. For more information about alerts, see [Azure Monitor alerts](../../azure-monitor/alerts/alerts-overview.md). |
| 77 | + |
| 78 | +## Next steps |
| 79 | + |
| 80 | +- Learn about [Web Application Firewall](../overview.md). |
| 81 | +- Learn about [Web Application Firewall Logs](../ag/web-application-firewall-logs.md). |
0 commit comments