"DeepLog LSTM: Anomaly Detection using LSTM and AI based root cause analysis
-
Build environment
git clone <repo> cd DeepLog-LSTM python -m venv venv . venv/bin/activate pip install -r requirements.txt
-
Run local example
We use open data
OpenStackfrom logpai's loghub2.1. Preprocess
cd example/ python preprocess.py
2.2. Train
num-classis count ofevent_id_map, whereevent_id_mapis generated bypreprocess.py.num-candidatesis self-define, here we definenum-candidatesisnum-class*0.1python train.py --num-class 1143 --num-candidates 114 --epochs 35 --window-size 3 --local True
2.3. Predict
python predict.py --threshold 25
2.4. UI
streamlit run frontend.py
Note: add your openai key to .streamlit/secrets.toml in project folder OPENAI_API_KEY=""
-
Result
Accuracy 0.9525801 Precision 0.9235754 Recall 0.6523478 F1 0.7646214
.
├── README.md
├── deeplog
│ ├── __init__.py
│ └── deeplog.py
├── example
│ ├── data
│ │ └── OpenStack
│ │ ├── anomaly_labels.txt
│ │ ├── openstack_abnormal.log
│ │ ├── openstack_normal1.log
│ │ └── openstack_normal2.log
│ ├── predict.py
│ ├── preprocess.py
│ ├── train.py
│ └── frontend.py
└── requirements.txt