TL;DR
This paper introduces Logs2Graphs, a novel approach for detecting anomalies in system logs by representing them as directed graphs and using Graph Neural Networks (GNNs). It achieves state-of-the-art performance, especially on complex log datasets, and importantly, provides explanations for detected anomalies.
What Problem Does This Paper Address?
Modern high-tech systems generate vast amounts of event logs, which are crucial for monitoring system health and diagnosing issues. Detecting anomalies in these logs is vital to prevent failures and ensure smooth operation. Existing methods often rely on quantitative (event counts) or sequential (event order) information, but these can miss complex anomalies that involve the overall structure of events. Furthermore, many current anomaly detection systems lack the ability to explain why an anomaly was flagged, hindering root cause analysis. This paper aims to address these limitations by proposing a method that leverages the rich structural information within logs and provides interpretable explanations.
Methods
The core of the proposed solution, Logs2Graphs, involves several key steps:
- Log Parsing and Grouping: Raw log messages are first parsed into structured log events. These events are then grouped into "log groups" (sequences) based on identifiers.
- Graph Construction: Each log group is transformed into an attributed, directed, and edge-weighted graph.
- Nodes: Represent individual log events.
- Node Attributes: Contain semantic embeddings of the log events (derived using GloVe and TF-IDF to capture word importance).
- Directed Edges: Connect events that sequentially follow each other within a log group.
-
Edge Weights: Indicate the frequency of a specific event sequence. This graph representation is more expressive than traditional undirected graphs, preserving temporal and sequential information.
-
Graph Neural Network (GNN) for Anomaly Detection: The authors introduce One-Class Digraph Inception Convolutional Networks (OCDiGCN). This novel GNN architecture is designed to learn representations of these directed graphs and perform anomaly detection in an unsupervised, end-to-end manner. It couples graph representation learning with anomaly detection objectives, optimizing a One-Class Deep SVDD loss function.
- Anomaly Explanation: For detected anomalies, OCDiGCN can identify and visualize a small subset of "important" nodes whose embeddings contributed most to the anomaly score. This provides insights into which specific log events or event sequences are indicative of the anomaly.
Datasets
The experiments were conducted on five publicly available benchmark datasets:
- HDFS: Hadoop Distributed File System logs.
- Hadoop: Logs from a Hadoop cluster.
- BGL: BlueGene/L supercomputing system logs.
- Spirit: Logs from the Spirit supercomputing system.
- Thunderbird: Logs from the Thunderbird supercomputing system.
These datasets are commonly used for log anomaly detection and contain ground truth labels and log identifiers for grouping.
Key Insights and Ideas
- Directed Graphs are Crucial: Representing logs as directed graphs, rather than undirected ones, significantly improves anomaly detection performance. This is because directed graphs can retain crucial temporal and sequential information that is lost in undirected representations.
- Semantic Embeddings Matter: Using semantic embeddings of log events as node attributes, rather than simple one-hot encodings, leads to substantial performance gains, highlighting the importance of capturing the meaning of log messages.
- End-to-End Learning for Graphs: Coupling graph representation learning and anomaly detection within a single GNN framework (OCDiGCN) leads to more accurate anomaly detection compared to methods that perform these steps separately.
- Explainability is Achievable: The proposed method can provide understandable explanations for detected anomalies by identifying key contributing nodes, which is a significant advantage for practical system monitoring.
Key Results
- Superior Performance: Logs2Graphs, powered by OCDiGCN, achieved state-of-the-art or comparable performance on most datasets. It notably outperformed competitors on complex datasets with a large number of log templates (BGL, Spirit, Thunderbird).
- Directed vs. Undirected: Logs2Graphs (using directed graphs) significantly outperformed GLAM (using undirected graphs) on most datasets, demonstrating the value of directed graph representations.
- Node Attributes Advantage: Using semantic node attributes improved ROC AUC scores by up to 7.86% compared to using only node labels.
- Robustness: The model showed some robustness to minor contamination in the training data, though significant contamination led to performance degradation.
- Structural Anomaly Detection: Logs2Graphs effectively detected structural anomalies and was less prone to high false positive rates on unseen normal instances compared to sequence-based methods.
Limitations and Future Work
- Dataset Limitations: The study used five publicly available datasets. The authors acknowledge that these may not fully represent the diversity of real-world industrial scenarios and plan to experiment with additional datasets.
- Competitor Selection: While a comprehensive set of baselines was used, some state-of-the-art methods (e.g., GLAD-PAW, CODEtect) were excluded due to unavailability of source code or prohibitive computational costs. Future work aims to include these.
- Training Data Purity: The model's performance degrades with significant contamination in the training data. Future work will explore techniques like adversarial training to improve robustness.
- Graph Construction Simplicity: The current graph construction relies on sequential event order. More sophisticated, application-specific methods for edge and weight assignment could be explored.
- Computational Cost: While the GNN training is efficient, the graph generation phase can be time-consuming, though it is amenable to parallelization. Future work might focus on optimizing this phase for online detection.
Summary updated