[论文解读] Self-Supervised Log Parsing
该论文提出 NuLog,一种基于 Transformer 架构的自监督日志解析方法,将日志解析建模为掩码语言建模(MLM)任务。通过预测被掩码的标记,NuLog 同时提取结构化日志模板和密集向量嵌入,实现了 99% 的平均解析准确率,在 10 个真实世界数据集上优于 12 种现有方法,并在下游异常检测任务中达到最高 0.999 的 F1 分数。
Logs are extensively used during the development and maintenance of software systems. They collect runtime events and allow tracking of code execution, which enables a variety of critical tasks such as troubleshooting and fault detection. However, large-scale software systems generate massive volumes of semi-structured log records, posing a major challenge for automated analysis. Parsing semi-structured records with free-form text log messages into structured templates is the first and crucial step that enables further analysis. Existing approaches rely on log-specific heuristics or manual rule extraction. These are often specialized in parsing certain log types, and thus, limit performance scores and generalization. We propose a novel parsing technique called NuLog that utilizes a self-supervised learning model and formulates the parsing task as masked language modeling (MLM). In the process of parsing, the model extracts summarizations from the logs in the form of a vector embedding. This allows the coupling of the MLM as pre-training with a downstream anomaly detection task. We evaluate the parsing performance of NuLog on 10 real-world log datasets and compare the results with 12 parsing techniques. The results show that NuLog outperforms existing methods in parsing accuracy with an average of 99% and achieves the lowest edit distance to the ground truth templates. Additionally, two case studies are conducted to demonstrate the ability of the approach for log-based anomaly detection in both supervised and unsupervised scenario. The results show that NuLog can be successfully used to support troubleshooting tasks. The implementation is available at https://github.com/nulog/nulog.
研究动机与目标
- 解决现有日志解析方法依赖人工启发式规则或领域特定规则的局限性。
- 开发一种可泛化、低人工干预的日志解析技术,适用于多种 IT 系统。
- 使学习到的日志表示可用于下游任务,如异常检测。
- 评估自监督学习在日志解析中的有效性及其在异常检测中的可迁移性。
提出的方法
- 使用基于 Transformer 的模型将日志解析建模为掩码语言建模(MLM)任务。
- 利用 [CLS] 标记的嵌入生成日志消息上下文的密集向量表示。
- 通过预测被掩码的标记,区分常量日志模板部分(预测正确)与可变参数部分(预测错误)。
- 将预训练的 MLM 表示作为下游异常检测任务的先验信息。
- 通过将最终的 softmax 层替换为二分类头,对模型进行微调以实现监督式异常检测。
- 通过标记被预测置信度较低的掩码标记比例较高的日志消息,实现无监督异常检测。
实验结果
研究问题
- RQ1自监督掩码语言建模能否在极少人工干预下,有效将半结构化日志消息解析为结构化模板?
- RQ2NuLog 在多种真实世界数据集上的解析性能与现有日志解析技术相比如何?
- RQ3自监督解析阶段学习到的日志嵌入能否有效迁移到下游异常检测任务中?
- RQ4NuLog 在监督式与无监督式异常检测场景下的性能表现如何?
主要发现
- NuLog 在 10 个真实世界日志数据集上实现了平均 99% 的解析准确率,优于 12 种现有日志解析方法。
- NuLog 到真实模板的编辑距离最低,表明其在解析中具有较高的结构保真度。
- 在 BGL 数据集上的无监督异常检测中,NuLog 实现了 0.999 的 F1 分数,精确率为 1.000,召回率为 0.999。
- 在监督式异常检测中,仅微调两个训练周期即达到 0.999 的 F1 分数,证明了学习表示的强大可迁移性。
- 该模型在多种系统中泛化良好,包括云基础设施、移动操作系统和应用日志,且仅需极少领域特定调整。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。