Abstract
Event logs are widely used to record the status of high-tech systems, making log anomaly detection important for monitoring those systems. Most existing log anomaly detection methods take a log event count matrix or log event sequences as input, exploiting quantitative and/or sequential relationships between log events to detect anomalies. Unfortunately, only considering quantitative or sequential relationships may result in low detection accuracy. To alleviate this problem, we propose a graph-based method for unsupervised log anomaly detection, dubbed Logs2Graphs, which first converts event logs into attributed, directed, and weighted graphs, and then leverages graph neural networks to perform graph-level anomaly detection. Specifically, we introduce One-Class Digraph Inception Convolutional Networks, abbreviated as OCDiGCN, a novel graph neural network model for detecting graph-level anomalies in a collection of attributed, directed, and weighted graphs. By coupling the graph representation and anomaly detection steps, OCDiGCN can learn a representation that is especially suited for anomaly detection, resulting in a high detection accuracy. Importantly, for each identified anomaly, we additionally provide a small subset of nodes that play a crucial role in OCDiGCN's prediction as explanations, which can offer valuable cues for subsequent root cause diagnosis. Experiments on five benchmark datasets show that Logs2Graphs performs at least on par with state-of-the-art log anomaly detection methods on simple datasets while largely outperforming state-of-the-art log anomaly detection methods on complicated datasets.
Introduction
In modern cloud computing and large-scale industrial systems, system logs serve as critical "black box" records for health monitoring. Detecting anomalies within these logs is essential for preventing failures, yet the volume and complexity of log data often exceed the capabilities of traditional analysis. Traditional methods generally rely on quantitative analysis (event frequencies) or sequence-based modeling (e.g., LSTMs). However, quantitative methods ignore temporal order, and sequence methods often fail to capture the global structural relationships of system behavior. Furthermore, many existing graph-based approaches utilize undirected graphs, losing vital directional information (e.g., "Event A precedes Event B").
The Logs2Graphs Framework
To address these limitations, we propose Logs2Graphs, an unsupervised framework that reimagines log entries as rich, directed graphs. The pipeline consists of four primary stages:
- Parsing & Grouping: Raw logs are transformed into structured templates using the Drain algorithm and grouped by session IDs or time windows.
- Graph Construction: Each unique log event is represented as a node. Directed edges represent the sequence of events, with weights indicating frequency. Nodes are enriched with semantic attributes using vector embeddings (GloVe + TF-IDF) to capture the meaning of log text.
- OCDiGCN Model: We introduce the One-Class Digraph Inception Convolutional Network (OCDiGCN). This GNN utilizes "Inception" blocks to aggregate information across multiple neighborhood scales and is specifically designed for directed graphs (digraphs).
- Anomaly Detection & Explanation: The model employs a Deep SVDD objective to map normal behavior into a tight hypersphere. Points falling outside this sphere are flagged as anomalies. A score decomposition rule identifies the specific nodes contributing most to the anomaly, providing human-readable explanations.
Experimental Evaluation
The Logs2Graphs framework was evaluated against eight state-of-the-art baselines across five diverse industry benchmark datasets, ranging from distributed file systems to supercomputer logs.
Key Insights
- Directionality and Semantics: The use of directed graphs significantly outperforms undirected counterparts by capturing the specific flow of operations. Additionally, semantic embeddings allow the model to recognize related events (e.g., "Network error" vs. "Connection failed") even if their specific event IDs differ.
- Structural Robustness: Logs2Graphs is particularly effective at identifying structural anomalies where event frequencies appear normal, but the relationships between events have deviated from the norm.
- Performance: On the BGL dataset, Logs2Graphs outperformed its closest competitor by 9.6% in ROC AUC. It achieved near-perfect scores (>0.99 ROC AUC) on the Spirit and Thunderbird datasets.
Conclusion
Logs2Graphs demonstrates that representing logs as attributed, directed graphs provides a more robust foundation for anomaly detection than traditional sequences or counts. By coupling graph representation learning with a one-class classification objective, the system achieves high accuracy and provides actionable explanations for identified anomalies. Future work will explore establishing edges based on long-distance dependencies and incorporating multi-modal system metrics.
Summary updated