Created
April 2, 2019 15:20
-
-
Save nbx3/28ecd236e60dc86e4949c8932d63982f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
OFFSET=${1:-1d} | |
SERVICE_FILTER="ccd-|sscs-|probate-|cmc-|div-|finrem-|fees-|bulk-" | |
TMP=$(mktemp) | |
az group list | jq -r '.[] | (.name)' | egrep ${SERVICE_FILTER} > ${TMP} | |
while read line | |
do | |
az monitor activity-log list \ | |
-g ${line} \ | |
--offset ${OFFSET} \ | |
| jq '.[] | select(.operationName.value | contains("Microsoft.Web/sites/slots/slotsswap/action"))' \ | |
| jq '{resourceGroup, eventTimestamp, operationName: .operationName.value, Status: .status.value}' | |
done < ${TMP} | |
rm ${TMP} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment