cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

Select distinct in SWQL studio vs custom table

Jump to solution

I am trying to create an SWQL query that shows all volume-related active alerts:

SELECT DISTINCT V.FullName, AA.TriggeredDateTime, AA.TriggeredMessage
FROM Orion.AlertActive AA
JOIN Orion.Volumes AS V ON (AA.AlertObjects.RealEntityUri = V.Uri)
WHERE AA.AlertObjects.EntityType LIKE 'Orion.Volumes' AND AA.AlertObjects.Node.CustomProperties.CustomerID LIKE 'A34' AND AA.AlertObjects.Node.Volumes.Type LIKE 'Fixed Disk'

In SWQL Studio, this query gives me exactly what I want:

pastedImage_3.png

But when I use this in my custom table resource, it seems like the distinct does not work. I end up getting a number of duplicates for each server:

pastedImage_4.png

The number of duplicated equals the number of monitored disks on each of the servers. Why is the "select distinct" only removing these duplicates in SWQL studio, and not in the custom table resource? Can I change the query in some way to avoid getting these duplicates?

0 Kudos
1 Solution
Level 15

without digging into the nitty gritty, my initial thought would be to replace the "Custom Table" resource in your report with a "Custom Query" resource.

View solution in original post

2 Replies
Level 15

without digging into the nitty gritty, my initial thought would be to replace the "Custom Table" resource in your report with a "Custom Query" resource.

View solution in original post

Level 8

That works a lot better! Thanks zackm!