So essentially I'm trying to pull the URL stored in componenttemplatesettings, use a SWQL replace statement to overwrite the ${IP} section with the IP of the node, and incorporate that into my alert for HTTP monitors. Here's the gist of the code - I'm unsure if this will work exactly but it does work in principle in SWQL explorer. I can pull the URL from ComponentTemplateSettings, and replace the ${IP} value with the IP of the node. Great.
SELECT
REPLACE(CTS.Value, '${IP}', (
SELECT A.Node.IP_Address
FROM Orion.APM.Component
JOIN Orion.APM.Application A ON A.ApplicationID = Component.ApplicationID
WHERE Component.ComponentID = 1
) as whatever
FROM Orion.APM.Component AS Component
JOIN Orion.APM.ComponentTemplateSetting CTS ON CTS.ComponentTemplateID = Component.TemplateID
WHERE Component.ComponentID = 1 AND CTS.Key = 'url'
The issue is that when attempting to use this in an email alert, using that ${IP} doesn't really work because this is wrapped in a ${N=SWQL;M=} block. I can replace IP, but I can't replace ${IP}, because the braces are messing with the statement. Is there any way to accomplish what I'm trying to achieve, any escape character I can use?