SOLVED

Is there a smart way to find out which Action Groups are in which Alerts?

%3CLINGO-SUB%20id%3D%22lingo-sub-1499250%22%20slang%3D%22en-US%22%3EIs%20there%20a%20smart%20way%20to%20find%20out%20which%20Action%20Groups%20are%20in%20which%20Alerts%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499250%22%20slang%3D%22en-US%22%3E%3CP%3EAfter%20a%20while%20you%20lose%20sight%20if%20an%20Action%20Group%20is%20connected%20to%20an%20Alert.%20Currently%20i'm%20not%20aware%20of%20a%20way%20to%20check%20which%20Action%20Groups%20are%20linked%20to%20which%20Alerts.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1499250%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAlerts%20%26amp%3B%20Actions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1499325%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20there%20a%20smart%20way%20to%20find%20out%20which%20Action%20Groups%20are%20in%20which%20Alerts%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499325%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F424832%22%20target%3D%22_blank%22%3E%40Juval%3C%2FA%3E%26nbsp%3Bif%20you%20use%20resource%20graph%20for%20metric%20alerts%20%22microsoft.insights%2Fmetricalerts%22%3C%2FP%3E%3CP%3Ethere%20is%20a%20actiongroupID%20in%20the%20properties%20section.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1502083%22%20slang%3D%22en-US%22%3ERe%3A%20Is%20there%20a%20smart%20way%20to%20find%20out%20which%20Action%20Groups%20are%20in%20which%20Alerts%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1502083%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F152036%22%20target%3D%22_blank%22%3E%40Billy%20York%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20tip!%20Thought%20of%20sharing%20if%20someone%20else%20needs%20the%20same%20info.%20This%20is%20what%20i%20scrambled%20up.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EResources%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eproject%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BalertName%26nbsp%3B%3D%26nbsp%3Bname%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Blocation%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Btype%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bprops%26nbsp%3B%3D%26nbsp%3Bproperties%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Btype%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Econtains%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22microsoft.insights%2Factivitylogalerts%22%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Emvexpand%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BactionGroups%26nbsp%3B%3D%26nbsp%3Bparse_json(props%5B%3C%2FSPAN%3E%3CSPAN%3E%22actions%22%3C%2FSPAN%3E%3CSPAN%3E%5D%5B%3C%2FSPAN%3E%3CSPAN%3E%22actionGroups%22%3C%2FSPAN%3E%3CSPAN%3E%5D)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BactionGroup%26nbsp%3B%3D%26nbsp%3Bextract(%40%3C%2FSPAN%3E%3CSPAN%3E%22(%5B%5E%3C%2FSPAN%3E%3CSPAN%3E%5C%3C%2FSPAN%3E%3CSPAN%3E%2F%5D%2B%24)%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%2Ctostring(actionGroups.actionGroupId))%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eunion%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B(%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bresources%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eproject%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BalertName%26nbsp%3B%3D%26nbsp%3Bname%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Blocation%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Btype%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bprops%26nbsp%3B%3D%26nbsp%3Bproperties%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Btype%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Econtains%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22microsoft.insights%2Fmetricalerts%22%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Emvexpand%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BactionGroups%26nbsp%3B%3D%26nbsp%3Bparse_json(props%5B%3C%2FSPAN%3E%3CSPAN%3E%22actions%22%3C%2FSPAN%3E%3CSPAN%3E%5D)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSPAN%3E%7C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3BactionGroup%26nbsp%3B%3D%26nbsp%3Bextract(%40%3C%2FSPAN%3E%3CSPAN%3E%22(%5B%5E%3C%2FSPAN%3E%3CSPAN%3E%5C%3C%2FSPAN%3E%3CSPAN%3E%2F%5D%2B%24)%22%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%2Ctostring(actionGroups.actionGroupId))%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B)%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

After a while you lose sight if an Action Group is connected to an Alert. Currently i'm not aware of a way to check which Action Groups are linked to which Alerts.

2 Replies
Best Response confirmed by Juval (Occasional Contributor)
Solution

@Juval if you use resource graph for metric alerts "microsoft.insights/metricalerts"

there is a actiongroupID in the properties section.

@Billy York 
Hi,

 

Thanks for the tip! Thought of sharing if someone else needs the same info. This is what i scrambled up.

 

Resources
project
    alertName = name,
    location,
    type,
    props = properties
where type contains "microsoft.insights/activitylogalerts" 
mvexpand actionGroups = parse_json(props["actions"]["actionGroups"])
extend actionGroup = extract(@"([^\/]+$)",1,tostring(actionGroups.actionGroupId))
union 
    (
        resources
        | project
            alertName = name,
            location,
            type,
            props = properties
        | where type contains "microsoft.insights/metricalerts" 
        | mvexpand actionGroups = parse_json(props["actions"])
        | extend actionGroup = extract(@"([^\/]+$)",1,tostring(actionGroups.actionGroupId))
    )