Kusto query to find vms that had issues installing updates

bombbe 1,466 Reputation points
2022-11-03T12:43:01.657+00:00

Hi,
I'm using Azure Update Management to patch Windows servers and because there is no build in query or some kind of dashboard to terminate that I need to make it by my self.

The table are UpdateRunProgress updaterunprogress

256715-image.png

My goal query should work somehow like this that if InstallationStatus has gone from NotStarted to something else than Succeeded it should be displayed in results. I have now tried almost everything and used Join operator but have not managed to get this work.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andrew Blumhardt 10,071 Reputation points Microsoft Employee
    2022-11-03T12:52:45.233+00:00

    I don't have this active in a lab for testing.

    Would it not be sufficient just to query for status other than NotStarted o Completed?

    I would do something like (Just an untested sample) if you need to correlate:

    let NotStarted = UpdateRunProgress
    | where InstallationStatus == "NotStarted"
    | summarize arg_max(TimeGenerated, *) by Computer ;
    let Status = UpdateRunProgress
    | where InstallationStatus != "NotStarted"
    | summarize arg_max(TimeGenerated, *) by Computer ;
    NotStarted
    | join (Status ) on Computer
    | where InstallationStatus_1 != "Successded"


  2. Wilko van de Velde 2,241 Reputation points
    2022-11-11T12:30:06.11+00:00
    UpdateRunProgress  
    | extend NextRecord = next(InstallationStatus)  
    | where InstallationStatus == "NotStarted" and NextRecord  != "Succeeded "  
      
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.