I've created a variable that extracts the dst-ip from the syslog message received from a node. Here's the query:
${N=SWQL;M=SELECT SUBSTRING('${N=OLM.AlertingMacros;M=OLMAlertMessage.EventMessage}',
CHARINDEX('dst-ip:', '${N=OLM.AlertingMacros;M=OLMAlertMessage.EventMessage}') + 7,
CHARINDEX(' ', '${N=OLM.AlertingMacros;M=OLMAlertMessage.EventMessage}' + ' ',
CHARINDEX('dst-ip:', '${N=OLM.AlertingMacros;M=OLMAlertMessage.EventMessage}') + 7) -
(CHARINDEX('dst-ip:', '${N=OLM.AlertingMacros;M=OLMAlertMessage.EventMessage}') + 7))
AS Message
FROM Orion.Nodes n}
When used in the email body, the query works perfectly and returns the expected IP address. However, using the same query in the email subject results in a blank output.
I'm wondering if this could be due to a restriction on using query-based variables in the email subject, or if there is a character limit that prevents the query from executing properly. I’ve tried looking for documentation to confirm this behavior but couldn’t find any relevant details.