ExplainLOG is a visual analytics dashboard that helps site reliability engineers understand failure patterns in Hadoop (HDFS) logs without reading raw text. It combines unsupervised anomaly detection, interactive coordinated views, and LLM-generated cluster explanations in a single interface.
The system detects anomalous block sessions using an LSTM autoencoder, groups them into semantic failure clusters using HDBSCAN, and explains each cluster in plain English using Llama 3.1 8B running locally via Ollama. Four coordinated views — a D3.js timeline, a Deck.gl UMAP scatter plot, a session table with color-coded event chips, and an LLM explanation panel — are linked via a shared state store so any interaction updates all views simultaneously.
- ML Pipeline: Python, Polars, PyTorch, scikit-learn, UMAP, HDBSCAN
- Backend: FastAPI, DuckDB, Ollama (Llama 3.1 8B)
- Frontend: React 18, TypeScript, Vite, D3.js, Deck.gl, Zustand
ExplainLOG/
├── pipeline/ # ML pipeline (steps 1-6)
├── backend/ # FastAPI server
├── frontend/ # React dashboard
├── data/ # Dataset files go here (see Dataset Setup)
├── precache.py # Pre-caches LLM explanations before demo
├── checkscores.py # Utility to inspect anomaly score distributions
└── requirements.txt
ExplainLOG uses the HDFS LogHub v1 dataset. The raw files are not included in this repository due to size. The author has allowed to use the dataset and its publicly available. The raw lines were converted into processed files by the author and we are using those files directly. https://people.iiis.tsinghua.edu.cn/~weixu/sospdata.html
Download from Box Folder:
https://ucdavis.box.com/s/61h8m8alh2pk4db89tiezhsqfl015l8g
Extract and place these four files into data/:
anomaly_label.csv
event_traces.csv
event_matrix.csv
log_templates.csv
- Python 3.10 or higher
- Node.js 18 or higher
- Ollama — install from their website
git clone https://github.com/hima-v/ExplainLOG.git
cd ExplainLOGpython -m venv .venv
# On Windows:
.venv\Scripts\Activate.ps1
# On macOS/Linux:
source .venv/bin/activatepip install -r requirements.txtollama pull llama3.1:8bThis downloads approximately 4.9 GB. Wait for it to complete.
cd frontend
npm install
cd ..Run this once after placing the dataset files in data/. It takes
approximately 20 minutes on a CPU-only machine.
python -m pipeline.run_allThis produces all required Parquet files in data/processed/. You do
not need to re-run the pipeline unless you change the data or parameters.
You need three terminals running simultaneously. Start them in this order.
ollama serveLeave this running. On Windows, Ollama may start automatically after
installation. If you see address already in use, it is already
running — skip this step.
cd backend
# activate your virtual environment if not already active
# Windows: ..\.venv\Scripts\Activate.ps1
# macOS/Linux: source ../.venv/bin/activate
uvicorn main:app --reload --port 8000Wait until you see Application startup complete.
API documentation available at: http://localhost:8000/docs
cd frontend
npm run devWait until you see Local: http://localhost:5173/
Open http://localhost:5173 in your browser.
The first LLM call per cluster takes ~50 seconds on CPU. Run this once with the backend already running to pre-cache all 8 cluster explanations:
# in a new terminal, from the repo root
python precache.pyThis takes approximately 7 minutes total. After it finishes, all explanations load in under 100ms from disk cache.
- Timeline — drag to brush a time window; the scatter plot dims points outside the selection
- UMAP Scatter — click any colored cluster to select it
- Session Table — shows individual block sessions for the selected cluster with color-coded event chips (blue = normal, red = exception)
- LLM Explain — shows a plain-language explanation of the selected cluster's failure pattern; use Confirm/Reject to record your feedback
- First LLM explanation per cluster takes ~50 seconds on CPU (instant after pre-caching)
- Some UMAP clusters overlap visually because dimensionality reduction from 29D to 2D loses some separation
- The timeline uses synthetic hourly binning since raw HDFS timestamps are not directly available in the pre-parsed dataset files