Here is the code below that I would like to be able to either add one node, one application or select by nodes and or application within the code below:
SELECT
Count(c.AlertObject.AlertActive.TriggeredMessage) AS TheCount
, CASE WHEN D.Link is null then NULL
ELSE CONCAT(D.Link,'?filters=', c.InstanceSiteId, '_Orion.AlertConfigurations_Severity:eq:', c.Severity)
END AS Link
, CASE WHEN c.Severity = 2 then '#950000'
WHEN c.Severity = 3 then '#DD2C00'
WHEN c.Severity = 1 then '#FEC405'
WHEN c.Severity = 0 then '#176998'
WHEN c.Severity = 4 then '#999999' END AS [Color]
, CASE WHEN c.Severity = 2 then 'Critical'
WHEN c.Severity = 3 then 'Serious'
WHEN c.Severity = 1 then 'Warning'
WHEN c.Severity = 0 then 'Informational'
WHEN c.Severity = 4 then 'Notice' END AS [Severity]
, CASE WHEN c.Severity = 2 then 'severity_critical'
WHEN c.Severity = 3 then 'severity_critical'
WHEN c.Severity = 1 then 'severity_warning'
WHEN c.Severity = 0 then 'severity_info'
WHEN c.Severity = 4 then 'severity_info' END AS [StatusIcon]
, CASE WHEN c.Severity = 2 then 1
WHEN c.Severity = 3 then 2
WHEN c.Severity = 1 then 3
WHEN c.Severity = 0 then 4
WHEN c.Severity = 4 then 5 END AS [severity_order]
FROM Orion.AlertConfigurations c
LEFT JOIN
(
SELECT TOP 1 '/apps/platform/dashboard/' + TOSTRING(DashboardID) as Link
FROM Orion.Dashboards.Instances
WHERE DisplayName = 'Servers Summary - Alert Status'
ORDER BY DashboardID
) D ON 1=1
WHERE c.AlertObject.AlertActive.TriggeredMessage <> ''
AND (c.AlertObject.Node.Category=2)
GROUP BY c.Severity, D.Link, c.InstanceSiteId
ORDER BY severity_order
This is what object looks like