How to find both unhealthy and healthy VM count in single query?

Highlighted
Occasional Visitor

I need to add both unhealthy and healthy VM count in a single graph?

I have the query for individual graphs from https://blogs.technet.microsoft.com/robdavies/2017/12/29/monitoring-application-gateway-with-azure-l...

1 Reply
Highlighted

Hi,

 

Without knowing the details of the shape of your data, the general pattern I'd follow is the following:

let q1 = (){
    query1_goes_here
    | extend state = "healthy"
};
let q2 = (){
    query2_goes_here
    | extend state = "unhealthy"
};
union q1,q2
| summarize ... by ..., bin(timestamp, ...), state
| render ...

Hope that helps, but if you need more specific help, please provide some sample data for both queries (even if the data is the general shape and mocked up with fake values), and we can help put a more specific query together.