This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

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

    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.