Loglizer 是一个基于机器学习的日志分析工具包,用于自动化异常检测。
Loglizer是一款基于AI的日志大数据分析工具, 能用于自动异常检测、智能故障诊断等场景
日志在众多软件系统的开发和维护过程中至关重要。它们记录了系统运行期间的详细运行时信息,使开发人员和运维工程师能够监控其系统并跟踪异常行为和错误。Loglizer 提供了一套工具包,实现了多种基于机器学习的日志分析技术,用于自动化异常检测。
🔭 如果您在研究中使用了 Loglizer,并希望发表论文,请引用以下论文。

用于异常检测的日志分析框架通常包含以下组件:
当前可用的异常检测模型:
我们收集了一套带标签的日志数据集,放在 loghub 中,供研究使用。如果您对这些数据集感兴趣,请点击链接提交访问请求。
git clone https://github.com/logpai/loglizer.git
cd loglizer
pip install -r requirements.txt
# Load HDFS dataset. If you would like to try your own log, you need to rewrite the load function.
(x_train, y_train), (x_test, y_test) = dataloader.load_HDFS(...)
# Feature extraction and transformation
feature_extractor = preprocessing.FeatureExtractor()
feature_extractor.fit_transform(...)
# Model training
model = PCA()
model.fit(...)
# Feature transform after fitting
x_test = feature_extractor.transform(...)
# Model evaluation with labeled data
model.evaluate(...)
# Anomaly prediction
x_test = feature_extractor.transform(...)
model.predict(...) # predict anomalies on given data
更多详情请参阅 docs 中的 演示 以快速上手。请注意,所有机器学习模型都不是魔法,您需要了解如何调整参数,才能让它们适用于您自己的数据。
如果您想重现以下结果,请在完整 HDFS 数据集上运行 benchmarks/HDFS_bechmark.py(HDFS100k 仅用于演示)。
如果有任何问题或反馈,请在 issue 页面 发帖。
| 模型 | 论文参考文献 |
|---|
| 监督模型 | |
| LR | [EuroSys'10] Fingerprinting the Datacenter: Automated Classification of Performance Crises, by Peter Bodík, Moises Goldszmidt, Armando Fox, Hans Andersen. [Microsoft] |
| Decision Tree | [ICAC'04] Failure Diagnosis Using Decision Trees, by Mike Chen, Alice X. Zheng, Jim Lloyd, Michael I. Jordan, Eric Brewer. [eBay] |
| SVM | [ICDM'07] Failure Prediction in IBM BlueGene/L Event Logs, by Yinglung Liang, Yanyong Zhang, Hui Xiong, Ramendra Sahoo. [IBM] |
| 无监督模型 | |
| LOF | [SIGMOD'00] LOF: Identifying Density-Based Local Outliers, by Markus M. Breunig, Hans-Peter Kriegel, Raymond T. Ng, Jörg Sander. |
| One-Class SVM | [Neural Computation'01] Estimating the Support of a High-Dimensional Distribution, by John Platt, Bernhard Schölkopf, John Shawe-Taylor, Alex J. Smola, Robert C. Williamson. |
| Isolation Forest | [ICDM'08] Isolation Forest, by Fei Tony Liu, Kai Ming Ting, Zhi-Hua Zhou. |
| PCA | [SOSP'09] Large-Scale System Problems Detection by Mining Console Logs, by Wei Xu, Ling Huang, Armando Fox, David Patterson, Michael I. Jordan. [Intel] |
| Invariants Mining | [ATC'10] Mining Invariants from Console Logs for System Problem Detection, by Jian-Guang Lou, Qiang Fu, Shengqi Yang, Ye Xu, Jiang Li. [Microsoft] |
| Clustering | [ICSE'16] Log Clustering based Problem Identification for Online Service Systems, by Qingwei Lin, Hongyu Zhang, Jian-Guang Lou, Yu Zhang, Xuewei Chen. [Microsoft] |
| DeepLog (coming) | [CCS'17] DeepLog: Anomaly Detection and Diagnosis from System Logs through Deep Learning, by Min Du, Feifei Li, Guineng Zheng, Vivek Srikumar. |
| AutoEncoder (coming) | [Arxiv'18] Anomaly Detection using Autoencoders in High Performance Computing Systems, by Andrea Borghesi, Andrea Bartolini, Michele Lombardi, Michela Milano, Luca Benini. |
| HDFS |
|---|
| 模型 | 精确率 | 召回率 | F1 |
| LR | 0.955 | 0.911 | 0.933 |
| Decision Tree | 0.998 | 0.998 | 0.998 |
| SVM | 0.959 | 0.970 | 0.965 |
| LOF | 0.967 | 0.561 | 0.710 |
| One-Class SVM | 0.995 | 0.222 | 0.363 |
| Isolation Forest | 0.830 | 0.776 | 0.802 |
| PCA | 0.975 | 0.635 | 0.769 |
| Invariants Mining | 0.888 | 0.945 | 0.915 |
| Clustering | 1.000 | 0.720 | 0.837 |