Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 12

How do you format custom script message returns to multiple lines?

I've been able to get nicely formatted lines with custom SQL monitors, but not with the custom script monitor. Is there a way to format a message so that you can have multiple lines rather than cramming your message into a single row?

For example, I'm hitting an API and counting the number of alarms as the statistic, but in the message, I want to cleanly list out the alarms in distinct rows. Right now, I have them joined in a way that makes it semi-eyeball friendly, but it would read a lot better if the message listed each alarm neatly in a row contained in the message. 


What it looks like now:



What I want it to look like...


0 Kudos
1 Reply
Level 12

Just to follow up on this, using a little html markup when joining results was the trick.


$messageAlarmDetails = $alarmDetails -join " ]`<br`>`t[ "
$messageAlarmDetails = "Alarm Details: `<br`>`t[ $($messageAlarmDetails) ]"


One side affect is that the markup shows up in component statistic views, however in reports (when allow HTML is selected), it works great. 

0 Kudos