I found the following example :
Get-SwisData $swis "SELECT ID,EntityUri, SuppressFrom, SuppressUntil FROM Orion.AlertSuppression" | Format-Table
Is there a way to have this return the actual device name instead of the EntityUri?
so there might be an easier way to do it but the way I could find would be to do a join to the appropriate tables and match it on the entityuri column. Below is one that I wrote for applications, from there you should be able to add on to it for Nodes, Interfaces, Transactions, etc
SELECT ae.ID, ae.EntityUri, ae.SuppressFrom, ae.SuppressUntil, a.FullyQualifiedName FROM Orion.AlertSuppression aejoin Orion.APM.Application A on ae.EntityUri=a.Uri
Thanks Chris, you are getting to be my go to guy.
This may be beyond the scope, but can you explain the variables like A and ae?
They're just aliases for the tables. The query could be written like this to be a little more clear:
SELECT AlertSuppression.ID , AlertSuppression.EntityUri , AlertSuppression.SuppressFrom , AlertSuppression.SuppressUntil , Application.FullyQualifiedNameFROM Orion.AlertSuppression AS AlertSuppressionINNER JOIN Orion.APM.Application AS Application ON AlertSuppression.EntityUri = Application.Uri
Thank for clarifying this. I didn't realize that you could create the variable without using the AS command.
Ah, yeah, great point. It's always good be explicit and use 'AS' when you alias. If you don't it definitely can confuse folx.