The current output is xxxx and I would like it to look like xx.xx. How do I format the decimal point for the following.
${N=SwisEntity;M=CustomPollerStatusScalar.Status}
@jmpenney01,
Expanding on what @sguido provided, I think the best way to do this would be via a custom SQL variable. I say that because when you use a SWQL variable, it MUST be tied to an entity table in the Orion API. It's not ideal for conversions (but possible). I just prefer it in SQL when I don't need to select something and I'm strictly using it as a means for parsing output.
So with that, here's a variable you could use to do this in an email alert. Let us know if it doesn't work.
${SQL: SELECT TOP 1 CONCAT(SUBSTRING('${N=SwisEntity;M=CustomPollerStatusScalar.Status}', 1, LEN('${N=SwisEntity;M=CustomPollerStatusScalar.Status}') - 2), '.', SUBSTRING('${N=SwisEntity;M=CustomPollerStatusScalar.Status}', LEN('${N=SwisEntity;M=CustomPollerStatusScalar.Status}') - 1, 2)) AS [myOutput]}
I use the following SWQL functions:- Concat(a, b, c, ...) - Takes one or more arguments and returns a single string that is the concatenation of the values of the arguments.- SubString(s, start, length) - Returns a substring of length characters starting at position start (the first character is position 1).- Length(s) - Returns the length of string s.CONCAT(SubString(Value,1,length(Value)-2),'.',SubString(Value,length(Value)-1,2))
So your SWQL would look something like:
CONCAT(SubString(${N=SwisEntity;M=CustomPollerStatusScalar.Status},1,length(${N=SwisEntity;M=CustomPollerStatusScalar.Status})-2),'.',SubString(${N=SwisEntity;M=CustomPollerStatusScalar.Status},length(${N=SwisEntity;M=CustomPollerStatusScalar.Status})-1,2))
I've used it in display widgets but not in EMail or Alert messages so it may need some testing.
I've used this in creating table widgets but not in Emails or Alert messages.
Thank you for this information.
However, how would I format this SWQL statement for use in the alert email message?
Cool, that worked
Thank you