Detecting Large-Scale System Problems by Mining Console Logs

Wei Xu, Ling Huang, Armando Fox, David A. Patterson, Michael I. Jordan

Executive Summary

This paper presents a general methodology for automatically detecting runtime problems in large-scale systems by mining console logs. By using source code as a "schema" to parse unstructured text into numerical features, the authors apply machine learning (PCA) to identify anomalies in message sequences with over 90% precision and near-perfect recall.

The Challenge of Datacenter Logs

In massive datacenter environments, console logs are often the only window into a system's health, yet they are notoriously difficult to use. Logs are voluminous, intermixed across hundreds of independent software components, and written by different developers with varying styles.

Traditional methods—like manual grepping for "ERROR" or "CRITICAL"—fail because many system failures don't trigger an explicit error message; instead, they manifest as missing events or abnormal sequences of otherwise "normal" messages. This paper aims to bridge the gap between raw, messy text logs and actionable operational insights without requiring manual rule-writing.

Methodology

The authors propose a four-step workflow to transform logs into a format suitable for machine learning:

  1. Log Parsing: Instead of guessing patterns, the method uses the system's source code (or binaries) to identify the "schema" of the logs. It separates the constant part of a log (the message type) from the variable part (the message variables).
  2. Feature Creation: Messages are grouped by identifiers (like a transaction ID or block ID) to reconstruct logical execution paths. These are converted into numerical vectors:
  3. Message Count Vectors: A "bag-of-words" approach counting how many times each message type appears in a sequence.
  4. State Ratio Vectors: Capturing the distribution of state variables (e.g., "COMMITTING" vs "ABORTING").
  5. Machine Learning: The authors use Principal Component Analysis (PCA) to detect anomalies. Since normal system behavior is highly repetitive, it falls into a low-dimensional "normal" subspace. Anything that deviates significantly from this subspace is flagged as an anomaly.
  6. Visualization: To make the results interpretable for operators, the system generates a one-page decision tree that highlights the specific messages associated with the detected problem.
The four-step analysis workflow: Parsing, Feature Creation, Anomaly Detection, and Visualization.

For real-time use, they introduce a two-stage Online Detection system. The first stage uses frequent pattern mining to quickly filter out 80-90% of "normal" events, leaving only the complex cases for the more computationally expensive PCA stage.

Datasets Evaluated

The methodology was evaluated on two primary large-scale systems:

  • Darkstar: An online game server (Sun Microsystems) where logs were collected from a single node.
  • Hadoop (HDFS): A distributed file system where logs were collected from 203 nodes on Amazon EC2, totaling over 24 million lines.

The authors also surveyed 29 different systems (including Apache, Map-Reduce, and various proprietary apps) to confirm that their assumptions about log structures—specifically the prevalence of identifiers and state variables—hold true across the industry.

Key Insights

  • Source Code is the Schema: The most powerful insight is that logs aren't actually "unstructured." They are generated by a finite set of printf or log.info statements. By looking at the code, you can perfectly parse any log message, even rare ones that a pattern-miner might miss.
  • Identifiers are the Glue: Individual log lines are often useless in isolation. By grouping logs by identifiers (like a block_id), the authors can reconstruct the "story" of a specific data block as it moves through a distributed system.
  • State vs. Identity: The paper distinguishes between variables that identify an object (many distinct values) and those that describe its status (few distinct values). This distinction is crucial for building high-quality features.

Key Results

The approach proved highly effective in both offline and online scenarios:

  • Accuracy: In offline tests on HDFS, the system achieved 91% precision and 99.3% recall.
  • Online Performance: The online version maintained a 100% recall, though precision dropped slightly to 86% due to ambiguous cases caused by time-windowing.
  • Real-world Discovery: The tool successfully identified performance issues in Darkstar caused by excessive transaction aborts and retries—a problem that was previously difficult to diagnose because the individual messages looked "normal."
Precision and recall results for online and offline experiments.

Limitations and Future Work

While the system is powerful, it currently relies on having access to source code or binaries for the best parsing results. The authors also note that the online detection precision can be affected by how event traces are segmented over time.

Future directions include:

  • Multi-layer Analysis: Analyzing logs from different layers of the stack (e.g., OS, middleware, and application) simultaneously.
  • Human-in-the-loop: Incorporating operator feedback to refine detection and reduce false positives.
  • Robustness: Improving the machine learning models to handle "defective" logs that might have missing or corrupted messages due to logging failures.

Summary updated

BibTeX
@inproceedings{xu2010detecting,
  author = {Wei Xu and Ling Huang and Armando Fox and David A. Patterson and Michael I. Jordan},
  title = {{Detecting Large-Scale System Problems by Mining Console Logs}},
  booktitle = {International Conference on Machine Learning},
  year = {2010},
}
Figure