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

Occasional Visitor

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

I have the query for individual graphs from

1 Reply



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

let q1 = (){
    | extend state = "healthy"
let q2 = (){
    | 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.