Log-based Anomaly Detection Without Log Parsing

Van-Hoang Le, Hongyu Zhang

Introduction

Automated anomaly detection is critical for maintaining the reliability of large-scale distributed systems. Traditionally, these systems rely on a multi-stage pipeline where raw, semi-structured logs are first processed by a "log parser" to extract constant templates and variable parameters. However, this approach creates a significant "parsing wall" that limits the effectiveness of downstream detection models. NeuralLog is a novel framework designed to bypass this bottleneck by performing anomaly detection directly on raw log messages using deep learning.

The Limitations of Traditional Log Parsing

Most existing detection systems follow a rigid workflow: converting raw logs into structured templates (e.g., Served block * to *). This process introduces two primary points of failure:

  1. Semantic Loss: Parsers often strip away variable information that may contain crucial diagnostic signals. By grouping distinct events into generic templates, the detector loses the ability to distinguish between normal and anomalous states.
  2. Out-of-Vocabulary (OOV) Issues: As software evolves, new log formats emerge. Traditional parsers struggle to categorize these unseen messages, leading to significant noise in the data.
Traditional log parsing pipeline converting raw logs into structured templates and parameters.

Research indicates that even state-of-the-art parsers can degrade detection accuracy by as much as 29%. The prevalence of OOV words remains a persistent challenge even as training datasets grow, particularly in complex environments like supercomputing clusters.

Percentage of Out-of-Vocabulary (OOV) words in testing sets across different training set sizes for BGL and Thunderbird datasets.

The NeuralLog Architecture

NeuralLog eliminates the parsing step entirely, utilizing a three-stage architecture to process raw logs:

1. Preprocessing

Instead of template extraction, NeuralLog performs simple tokenization. It converts logs to lowercase and removes non-character tokens (punctuation and digits) to reduce noise while preserving the core semantic structure of the message.

2. Neural Representation (BERT + WordPiece)

To solve the OOV problem, NeuralLog employs WordPiece tokenization. This technique breaks rare or unknown technical terms into smaller, meaningful subwords (e.g., "datablockscanner" becomes "data," "block," "scan," "ner"). These subwords are then processed by a pre-trained BERT model to generate a high-dimensional semantic vector for every log message. This allows the model to "understand" the context of messages it has never encountered before.

3. Transformer-based Classification

A sequence of these semantic vectors is fed into a Transformer encoder. By utilizing multi-head self-attention mechanisms, the Transformer captures long-range dependencies and the specific ordering of events. This is essential for identifying "concurrency anomalies," where individual log entries appear normal, but their sequential context indicates a failure.

Experimental Results

NeuralLog was evaluated against four major public benchmarks: HDFS (11.1M messages), BGL (4.7M messages), Thunderbird (10M messages), and Spirit (1GB of logs).

  • High Accuracy: The model achieved F1-scores of 0.98 on HDFS and BGL, and 0.96–0.97 on Thunderbird and Spirit.
  • Robustness: In scenarios where traditional models like SVM failed (F1-score of 0.46 on BGL due to parsing errors), NeuralLog maintained near-perfect performance.
  • Real-time Viability: Despite the complexity of the BERT embeddings, the detection phase is highly efficient, processing log sequences in approximately 3.1 milliseconds.

Conclusion

By removing the fragile log parsing step, NeuralLog provides a more robust and accurate solution for system monitoring. While current iterations discard numerical metadata that could be useful for specific anomalies, the framework's ability to handle OOV words and capture complex event sequences represents a significant advancement in automated system diagnostics.

Summary updated

BibTeX
@inproceedings{le2021log,
  author = {Van-Hoang Le and Hongyu Zhang},
  title = {{Log-based Anomaly Detection Without Log Parsing}},
  booktitle = {ASE},
  year = {2021},
  doi = {10.1109/ase51524.2021.9678773},
}
Figure