I am trying to return the 2nd line from a field containing a string. I have tried indexof and split, and it gets me close, but have not had success using the newline \n.
How can I return "Assignment Group: TI-BSM-Tech Monitoring" or ideally "TI-BSM-Tech Monitoring" from the string below.
Call-out: true
Assignment Group: TI-BSM-Tech Monitoring
Data String - index=cisco_ise sourcetype=cisco:ise:syslog source=* Alert when critical services are no longer logging Hourly
Some code I have tried
var description = "Call-out: true Assignment Group: TI-BSM-Tech Monitoring next String - index=cisco_ise sourcetype=cisco:ise:syslog source=* Alert when critical services are no longer logging Hourly".split('Assignment Group:')[1];
var assignment = description.substring(description.indexOf('Group: ') + 2);
console.log(assignment);
Thanks