Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewmatveychuk/6528ac35aa295ff215a132a09a81b5f8 to your computer and use it in GitHub Desktop.
Save andrewmatveychuk/6528ac35aa295ff215a132a09a81b5f8 to your computer and use it in GitHub Desktop.
Get alerts in a time range in a resource group
alertsmanagementresources
| where properties.essentials.targetResourceGroup =~ '{ResourceGroup:resourcegroup}'
| where properties.essentials.startDateTime {TimeRange}
| where properties.essentials.monitorCondition in ({AlertCondition})
| extend severity = tostring(properties.essentials.severity),
alertCondition = tostring(properties.essentials.monitorCondition),
userResponse = tostring(properties.essentials.alertState),
targetResource = tostring(properties.essentials.targetResource),
fireTime = todatetime(properties.essentials.startDateTime)
| order by fireTime desc
| project name, severity, alertCondition, userResponse, targetResource, fireTime, properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment