OBLYTECH Logo
OBLYTECH Logo

Health Log Analytics: Setup, Alert Rules and Administration

Health Log Analytics (HLA) learns normal log behavior and raises alerts on its own, though some streams need a custom rule and alert handling benefits from tuning. This guide covers when to write a rule, how to control significance and noise, how to post alerts to Slack or Microsoft Teams, and how to manage retention.

How HLA sorts log streams before scoring them

HLA places each log stream into one of three patterns, and the pattern decides which detection logic applies.

A lively stream receives a log line at least once every 20 seconds, such as an application writing hundreds of entries an hour. The machine learning engine has enough volume to build a reliable baseline and applies standard anomaly scoring.

A sparse stream receives lines less than once a minute, such as a nightly batch job. Standard scoring would be unreliable there, so the engine uses probability distribution analysis. A sparse stream with very low volume can still produce no alerts, because there is not enough history to form a baseline.

A stopped stream has gone quiet. The default silence period is 300 seconds, set by the system property detective.resolution.signal_dead. A stream must first run continuously for a minimum period, set by detective.alive_period_seconds_for_signal_dead, before HLA can alert on it as stopped.

Scenario Automatic detection Custom alert rule
High-frequency logs with a lively pattern Likely sufficient Optional
Low-frequency or periodic logs Unreliable Suggested
Known critical conditions Insufficient Required

Defining a custom alert rule from a log search

Custom rules start from a search in the log data. In the Service Operations Workspace, open the Log Viewer, or the Surrounding logs tab of an alert, then:

  1. Define and run a search that returns the log lines that should count as an alert condition.
  2. Save the search, then select Define alert at the top right of the Log viewer tab.
  3. Enter a name and description. The name appears on the Anomaly card of each alert the rule generates.
  4. Set the State field, then select Enabled to activate the rule.
  5. Set the severity, complete the query and threshold fields, and select Save.

Rule severity has four levels. Low means attention is needed while the resource still functions. Medium means performance has degraded or a partial, non-critical loss of function has occurred. High means major functionality is severely impaired. Critical means immediate action is needed. The severity field needs Health Log Analytics version 20.0.11 (July 2021). The query and component fields need that version together with the Health Log Analytics Viewer application, version 20.0.4 (July 2021), both available from the ServiceNow Store.

The query defaults to the search on the Log viewer, and an asterisk matches all queries. The threshold controls when the rule fires:

Field Setting
Operator Fixed to Bigger Than
Hit count The number of matching log entries that triggers an alert
Time period and time unit Measured in minutes
Persistence Fixed at one minute

Changing and deleting custom rules

Open the selection icon at the top right of the Log viewer tab, choose Manage my defined alerts, and pick the rule from the Defined alerts table. Update the settings and select Save, or select Delete to retire it. Defining, changing and deleting rules, and the other alert tasks on this page, need the evt_mgmt_operator or evt_mgmt_admin role. The broader alert handling concepts sit alongside the Event Management guides.

Controlling significance and noise

HLA adjusts its behavior based on operator feedback, and four levers are available.

Feedback on individual alerts

Marking an alert as significant raises its metric’s priority, making it more likely to join a Log Analytics group when the metric behaves anomalously. Muting goes further. It removes the current alert and any other alert based on that metric from the feed, and HLA stops generating new ones. Restore normal importance returns a metric to default, and reactivating a muted metric restarts alerts.

For one alert, the Apply ML feedback drop-down offers Raise, which raises the threshold for similar future anomalies. Restore ML feedback reverses it. This is not available for customer alerts or new signal alerts.

Lexical keywords

Lexical keywords are standalone words such as failed or crashed that signal a condition worth attention. Unlike a key in a key:value pair, a keyword carries no value. HLA sets a threshold for each keyword from its normal occurrence pattern and alerts when the count exceeds it.

Keywords live in the Lexical Keywords table under Log Anomaly Detection. A record has a name, a regular expression, an Exact match option (True by default), a Case-sensitive option (False by default), and a Range of analysis covering all source types, one source type, or excluded source types.

Advanced log alert filters

Filters decide whether an alert is allowed or dropped. Examples include allowing alerts for anomalies shared across several hosts, dropping alerts outside working hours, and dropping alerts that do not cross a specified threshold. A filter can be tested, updated, published and activated while still in development.

Log correlators

Log correlators identify related alerts, which helps you judge whether an alert belongs to a larger issue. Free text correlators analyze the message portion of a log line and suit unstructured terms such as a thread identifier or the name of your own service. Log property correlators analyze the metadata portion, such as a service instance name or a request identifier. For a closer look at connecting log signals to service context, see the Log Analytics service context article.

Understanding alert types and severity

The Group column identifies the alert type, and each HLA alert carries the value Log Analytics in the Source column.

Alert type What it represents
Log Analytics alert An anomaly on one configuration item, from an unexpected log count or metric value. Group value is None
Log Analytics group Up to four related alerts, grouped by time window, matching metadata, similar message text, or a similar trend
Component-based alert A component made of several configuration items doing the same job, such as redundant hosts. Its read-only child alerts are context, so work happens on the parent

Severity follows a mapping. HLA converts the severity word in each raw log line to its own log severity, and Event Management then sets the alert severity:

Raw log severity HLA log severity Event Management severity
NOTICE, NOTIFICATION NOTICE LOW
WARNING, WARN WARNING MEDIUM
ERROR, ERR ERROR HIGH
CRITICAL, CRIT, FAT, FATAL, SEVERE CRITICAL CRITICAL
ALERT ALERT CRITICAL
EMERGENCY, EMER EMERGENCY CRITICAL

For numerical severities or unrecognized words, add a conditional JavaScript function in the Source Type Structure so those values map to the HLA Log Severity column.

Sending alert notifications to Slack or Microsoft Teams

HLA can post new anomaly alerts to a channel in real time. For general channel set-up, see the Slack integration guide and the Microsoft Teams integration guide.

For Slack, confirm that the Slack Webhooks Spoke for ServiceNow Integration Hub plugin is installed. For Microsoft Teams, version 33.0.27 (August 2024) and later use the Microsoft Teams Graph spoke application, which replaces the older Teams spoke plugin.

For Slack, or for Teams on Health Log Analytics versions earlier than 33.0.27:

  1. Create a webhook URL for the channel in Slack or Teams.
  2. In Health Log Analytics Administration, open Webhook Notification and select New.
  3. Enter the Webhook URL, select Active, and choose the Configuration item, the service instance behind the alerts. A blank item falls back to default.slack.webhook.url or default.teams.webhook.url.
  4. Select Submit.
  5. In Event Management, open Alert Management Rules, find Submit HLA alerts to slack or Submit HLA alerts to teams, and set Active to true.
  6. Optionally, select Alert Filter on that rule to set the conditions an alert must meet before it is posted.

From HLA 33.0.27 (August 2024), install the latest Microsoft Teams Graph spoke from the ServiceNow Store and set it up. Activate the Submit HLA alerts to teams rule under Event Management > Rules > Alert Management Rules by setting Active to true. Then open the sn_occ_teams_alert_notification_config form, enter the Teams ID and Channel ID taken from the Teams channel, and map the Configuration Item to the service instance. Leave Configuration Item empty to use the record that applies when no CI matches. If you upgrade from an earlier version to 33.0.27 or later, repeat the Teams setup.

Investigating an alert after it fires

Review the alert’s severity, the affected configuration item, the log data tied to the anomaly, and the services it affects. The Surrounding logs tab lists the lines from one minute before the alert to one second after it, and the range can be changed with the Select range list or a start and end time.

Administration: retention, properties and the CMDB

The base system typically provides 1,000 GB for log source retention, and the actual capacity depends on your license. The default retention period is three days, and you can change it.

Global properties, such as the silence and alive periods described above, are changed through the global system property settings.

HLA also reads host data from the logs it streams. When that host data does not match the Configuration Management Database, it creates a configuration item candidate for you to review. For how those records are kept in order, see the CMDB guides.

Frequently asked questions

Does each log stream need a custom alert rule?

No. A lively, high-frequency stream is usually covered by automatic detection, so a rule is optional there. Add one for low-frequency or periodic logs, where detection is unreliable, and for known critical conditions, where detection is insufficient.

Why did my alerts stop after I muted a metric?

Muting removes the current alert and any other alert based on that metric from the feed, and it stops HLA from generating new ones. Restore normal importance or reactivate the metric to start alerts again.

Which role is needed to change alert rules and notifications?

The evt_mgmt_operator or evt_mgmt_admin role covers defining, changing and deleting custom rules, the alert feedback actions, and the other alert tasks described here.

Why does a sparse log produce no alerts?

A sparse log arrives less than once a minute, so the engine uses probability distribution analysis. If its volume is too low to form a baseline, no alert is generated, and a custom rule can cover that case.

Can I limit which alerts reach a channel?

Yes. Open the Alert Management rule for the channel and set an Alert Filter with the conditions an alert must meet before it is posted.