@@ -31,6 +31,9 @@ This article uses the following starter queries:
31
31
- [ List all storage accounts with specific tag value] ( #list-specific-tag )
32
32
- [ List all tags and their values] ( #list-all-tag-values )
33
33
- [ Show unassociated network security groups] ( #unassociated-nsgs )
34
+ - [ List alerts by severity] ( #alerts-severity )
35
+ - [ List alerts by severity and resource type] ( #alerts-severity-state )
36
+ - [ List alerts by severity and resource type with a specific tag] ( #alerts-severity-service-type )
34
37
35
38
If you don't have an Azure subscription, create a [ free account] ( https://azure.microsoft.com/free )
36
39
before you begin.
@@ -654,6 +657,44 @@ Search-AzGraph -Query "Resources | where type =~ 'microsoft.network/networksecur
654
657
655
658
---
656
659
660
+ ## <a name =" alerts-severity " ></a >List alerts ordered by severity
661
+
662
+ ``` kusto
663
+ alertsmanagementresources
664
+ | where type =~ 'microsoft.alertsmanagement/alerts'
665
+ | where todatetime(properties.essentials.startDateTime) >= ago(2h) and todatetime(properties.essentials.startDateTime) < now()
666
+ | project Severity = tostring(properties.essentials.severity)
667
+ | summarize AlertsCount = count() by Severity
668
+
669
+ ```
670
+ ## <a name =" alerts-severity-state " ></a >List alerts ordered by severity and alert state
671
+
672
+ ``` kusto
673
+ alertsmanagementresources
674
+ | where type =~ 'microsoft.alertsmanagement/alerts'
675
+ | where todatetime(properties.essentials.startDateTime) >= ago(2h) and todatetime(properties.essentials.startDateTime) < now()
676
+ | project Severity = tostring(properties.essentials.severity),
677
+ AlertState= tostring(properties.essentials.alertState)
678
+ | summarize AlertsCount = count() by Severity, AlertState
679
+ ```
680
+
681
+ ## <a name =" alerts-severity-service-type " ></a >List alerts ordered by severity, monitor service, and target resource type
682
+
683
+ ``` kusto
684
+ alertsmanagementresources
685
+ | where type =~ 'microsoft.alertsmanagement/alerts'
686
+ | where todatetime(properties.essentials.startDateTime) >= ago(2h) and todatetime(properties.essentials.startDateTime) < now()
687
+ | project Severity = tostring(properties.essentials.severity),
688
+ MonitorCondition = tostring(properties.essentials.monitorCondition),
689
+ ObjectState = tostring(properties.essentials.alertState),
690
+ MonitorService = tostring(properties.essentials.monitorService),
691
+ AlertRuleId = tostring(properties.essentials.alertRule),
692
+ SignalType = tostring(properties.essentials.signalType),
693
+ TargetResource = tostring(properties.essentials.targetResourceName),
694
+ TargetResourceType = tostring(properties.essentials.targetResourceName), id
695
+ | summarize AlertsCount = count() by Severity, MonitorService , TargetResourceType
696
+ ```
697
+
657
698
## Next steps
658
699
659
700
- Learn more about the [ query language] ( ../concepts/query-language.md ) .
0 commit comments