LogFilter rule does not include hostname in email notification. Add hostname to email notification for LogFilter rule.
The LogFilter Rule in all Foglight 5 versions all the way up through OS Cart 5.5.8.x (may change in future version) does not include the hostname in the notification text variable. Here is what it looks like out of the box (see the Resolution below of what to change it to):
createObservationAlarms(#LogFilter_ErrorVerbose for 1 ms#,
{entry ->
if (entry.get("Severity") == "WARNING") {
return 2;
}
if (entry.get("Severity") == "CRITICAL") {
return 3;
}
if (entry.get("Severity") == "FATAL") {
return 4;
}
return 0;
},
{entry, severity -> switch(severity) {
case 2:
return "" + entry.get("LogName") + ": " + entry.get("Error_Message") + "";
case 3:
return "" + entry.get("LogName") + ": " + entry.get("Error_Message") + "";
case 4:
return "" + entry.get("LogName") + ": " + entry.get("Error_Message") + "";
default:
return "";
} },"542c111ff5feabe3803bccb722386cae");
1) Admin Console | Administration | Rules & Notifications | Manage Rules | Filter: LogFilter
2) Expand Severity 'Fire' | Action tab | edit EmailAction
3) Click on 'Severity Level Variables' | click on 'Text' varable to edit it | replace the Expression with the Expression listed below Step 4.
4) Once replaced, make sure to click 'Add' to save the changes (you will be asked if you want to replace the 'Text' variable - click 'Yes')....then select Save All to save the change to the rule
createObservationAlarms(#LogFilter_ErrorVerbose for 1 ms#,
{entry ->
if (entry.get("Severity") == "WARNING") {
return 2;
}
if (entry.get("Severity") == "CRITICAL") {
return 3;
}
if (entry.get("Severity") == "FATAL") {
return 4;
}
return 0;
},
{entry, severity -> switch(severity) {
case 2:
return "" + scope.monitoredHost?.name + "-" + entry.get("LogName") + ": " + entry.get("Error_Message") + "";
case 3:
return "" + scope.monitoredHost?.name + "-" + entry.get("LogName") + ": " + entry.get("Error_Message") + "";
case 4:
return "" + scope.monitoredHost?.name + "-" + entry.get("LogName") + ": " + entry.get("Error_Message") + "";
default:
return "";
} },"542c111ff5feabe3803bccb722386cae");
Also see: SOL75058 - "We want to add the name/path of the Log file and the match hit string to the email notification subject line (mail.subject). The body of the email (mail.message) has this information - how to add this to the mail.subject?"
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center