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

This works in classic dashbaord but when I try to put it into Modern it errors.

Jump to solution

    SELECT DISTINCT 

           CASE 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%' AND [EntityUri] NOT LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/%' 

                 THEN [N].[Caption] 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/Interfaces/InterfaceID=%' 

                 THEN [I].[FullName] 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/Applications/ApplicationID=%' 

                 THEN [AA].[FullyQualifiedName] 

              ELSE 'SomethingElse' 

           END AS [Element], 

           CASE 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%' AND [EntityUri] NOT LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/%' 

                 THEN [N].[DetailsUrl] 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/Interfaces/InterfaceID=%' 

                 THEN [I].[DetailsUrl] 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/Applications/ApplicationID=%' 

                 THEN [AA].[DetailsUrl] 

              ELSE 'SomethingElse' 

           END AS [_LinkFor_Element], 

           [AE].AccountID AS [By], 

           ToLocal([SuppressFrom]) AS [Start],        

           ToLocal([SuppressUntil]) AS [End] 

    FROM Orion.AlertSuppression AS [AlertSup] 

    LEFT OUTER JOIN Orion.Nodes AS [N] 

       ON [AlertSup].[EntityUri] = [N].[Uri] 

    LEFT OUTER JOIN Orion.NPM.Interfaces AS [I] 

       ON [AlertSup].[EntityUri] = [I].[Uri] 

    LEFT OUTER JOIN Orion.APM.Application AS [AA] 

       ON [AlertSup].[EntityUri] = [AA].[Uri] 

    LEFT OUTER JOIN Orion.AuditingEvents AS [AE] 

       ON [AE].AuditEventMessage LIKE CONCAT('%', CASE 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%' AND [EntityUri] NOT LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/%' 

                 THEN [N].[NodeName] 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/Interfaces/InterfaceID=%' 

                 THEN [I].[InterfaceCaption] 

              WHEN [EntityUri] LIKE 'swis://%/Orion/Orion.Nodes/NodeID=%/Applications/ApplicationID=%' 

                 THEN [AA].[Name] 

              ELSE 'Wrong' 

           END, '%') AND [EntityUri] LIKE CONCAT('%=', [AE].NetObjectID) 

    INNER JOIN Orion.AuditingActionTypes AS [AT] 

       ON [AE].ActionTypeID = [AT].ActionTypeID 

    WHERE [AT].ActionType IN  ( 'Orion.AlertSuppressionAdded', 'Orion.AlertSuppressionChanged' ) 

    ORDER BY [SuppressFrom] 

 

Provided SWQL query is not valid. Details: RunQuery failed, check fault information. ORDER BY items must appear in the select list if SELECT DISTINCT is specified.

 

 

0 Kudos
1 Solution
MVP
MVP

Are you sure you want the DISTINCT? I just removed it and it looks pretty distinct on its own.

View solution in original post

0 Kudos
1 Reply
MVP
MVP

Are you sure you want the DISTINCT? I just removed it and it looks pretty distinct on its own.

View solution in original post

0 Kudos