- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:27 PM
Hi.
I would like to create a business rule that sends an email when a specific message is output to syslog, but I don't know how to create a script to send the email.
Please let me know if you have any sample scripts.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 04:10 AM
Hi @__ __2
something like this -
// Check if the specific message is logged
var specificMessage = "Your specific message here";
if (gs.log.indexOf(specificMessage) !== -1) {
var recipientEmail = "recipient@example.com";
var emailSubject = "Syslog Message Notification";
var emailBody = "The specific message was logged: " + specificMessage;
// Send the email
var email = new GlideEmailOutbound();
email.setSubject(emailSubject);
email.setBody(emailBody);
email.addRecipient(recipientEmail);
email.send();
}
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:35 PM
Hello you can refer the below doc for the same
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2023 05:29 PM
It seems that the information I want to know is different.
I would like to know how to create a script for sending emails described in the Advanced tab of Business Rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 04:10 AM
Hi @__ __2
something like this -
// Check if the specific message is logged
var specificMessage = "Your specific message here";
if (gs.log.indexOf(specificMessage) !== -1) {
var recipientEmail = "recipient@example.com";
var emailSubject = "Syslog Message Notification";
var emailBody = "The specific message was logged: " + specificMessage;
// Send the email
var email = new GlideEmailOutbound();
email.setSubject(emailSubject);
email.setBody(emailBody);
email.addRecipient(recipientEmail);
email.send();
}
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar