Log data auto-mapping and mapping in Health Log Analytics
Summarize
Summary of Log data auto-mapping and mapping in Health Log Analytics
Health Log Analytics (HLA) in ServiceNow automatically maps incoming log lines to key tags such as service instance, component, and source type to help organize and analyze log data effectively. This auto-mapping can be customized manually using JavaScript functions or enhanced with AI-assisted mapping to optimize accuracy and reduce manual effort. Proper mapping facilitates correlation with Configuration Items (CIs) in the CMDB, which is critical for root cause analysis (RCA).
Show less
Key Features
- Auto-mapping of Logs: HLA assigns tags based on log metadata fields like source, path, and syslog tags, extracting meaningful identifiers such as components and source types automatically.
- Manual Mapping via JavaScript: Users can define JavaScript functions to override default mappings, organize logs by service instance and availability zone, and refine source and component assignments. Test mode allows previewing mapping outcomes without impacting production data or storage.
- AI-Assisted Mapping: ServiceNow Otto AI offers recommended mapping configurations based on log patterns, streamlining setup and improving mapping accuracy without custom scripts.
- Data Extraction Controls: Users can specify terms to extract from logs or suppress extraction of redundant or non-descriptive data to improve data quality and relevance.
- Source Management Limits: System properties help control and monitor the number of log sources created per data input, triggering warnings and stopping data input if limits are exceeded to prevent storage and processing issues.
- Binding Logs to CMDB CIs: Binding log entries to service instances linked to CIs enables enhanced searchability and correlation critical for analyzing system issues.
- Header Properties Detection: Automatically separates transport headers from the inner log message, ensuring only relevant log data is processed.
Key Outcomes
- Improved organization and classification of log data through automatic and customizable mapping methods.
- Reduced manual effort and increased accuracy in log data tagging using AI-assisted recommendations.
- Enhanced ability to correlate logs with CMDB configuration items, supporting effective root cause analysis and operational insights.
- Controlled management of log source creation to avoid system overload and storage issues.
- Greater control over log data extraction, enabling customers to focus on relevant information while filtering out noise.
- Safe testing environment for mapping scripts that prevents production impact and storage waste.
By default, the HLA Engine tries to auto-map every incoming log line to the correct tags. You can change automatic mapping results manually by defining a JavaScript function.
Auto-mapping incoming log lines
Health Log Analytics auto-mapping assigns log samples and metadata to three tags: service instance, component, and source type. The service instance assignment is based on the service instance specified in the data input setup. The remaining tags are assigned automatically.
For example, in the following example log line, Health Log Analytics uses the "source" field to find the component and source type.
{"beat":{"version":"6.8","name":"abc3.prd.acme.com","hostname":"abc3.prd.acme.com"},"@timestamp":"2020-08-27T10:12:24.792Z","prospector":{"type":"log"},"message":"**** User null is requesting the following page http://www.acme.com PROPS:{"subcategory1":"home pages","httpStatus":"200","loginLevel":"Anonymous","userAgent":"Mozilla5.0", ("pageUrl":\"http://www.acme.com","host":"abc3.prd.acme.com","@version":"1","source":"/opt/oracle/weblogic/abc/online_store3/logs/online_store3.out","offset":3951550786}
In the example, Health Log Analytics extracts the string "online_store". It analyzes the following fields if they exist in the log line: source, path, channel, namespace_name, name, pod_name, source_name, and aws_lambda_name. When data is sent over Syslog, it also analyzes the syslog tag.
- Stop extraction of unneeded data
- If an extracted string is not descriptive enough or contains redundant text or information, you can stop extracting such expendable data. For more information, see Stop extraction of unneeded log data in Health Log Analytics.
- Ensuring extraction of specific data
- You can make sure that Health Log Analytics extracts specific desired terms. For more information, see Extract specific log data in Health Log Analytics.
AI-assisted log mapping with ServiceNow Otto
AI-assisted log mapping using ServiceNow Otto recommends optimal mapping configurations based on your log patterns. This approach reduces manual setup effort and improves accuracy without requiring custom JavaScript functions.
For a walkthrough of how to set up and review AI-suggested mappings, see AI-assisted log mapping in Health Log Analytics.
Mapping data input sources manually by defining a JavaScript function
You can change automatic mapping results manually by defining a JavaScript function. Data input mapping enables you to organize your log data by service instance and by availability zone. A single service instance can include multiple components, and a component can receive logs from many different source types. An service instance-component pair, however, is unique. Source types are based on a specific log structure and format. Service instances and components are defined more broadly and are therefore used mainly for logical mapping.
Activating Test mode avoids blowing up Elasticsearch storage with sample data that is used only for perfecting the log data mapping. When the data input is in Test mode, Health Log Analytics doesn’t create the source types, sources, or any other objects it creates in the standard flow. It saves the streamed data in dedicated temporary Elasticsearch indices that appear as components in the Log viewer. When you publish the script and exit Test mode, these temporary indices are deleted to minimize storage space consumption.
| System property | Description | Default |
|---|---|---|
| log_source.sources_warning_limit | The warning limit for the number of sources created per data input. | 500 |
| log_source.sources_critical_limit | The critical limit for the number of sources created per data input. | 600 |
Binding log data
Binding log data to Configuration Items (CIs) in the Configuration Management Database (CMDB) enables you to search the CMDB for endpoints that match a log. When you configure a data input, you bind log entries to a service instance that is bound to a CI in the CMDB. Binding log entries, service instances, and CIs enables the HLA Engine to correlate them for use in root cause analysis (RCA). For more information, see Configure a Rsyslog, Filebeat, or Winlogbeat data input in Health Log Analytics manually or Configure an Elasticsearch data input in Health Log Analytics manually.