An open-source, lightweight tool to analyze security logs, detect anomalies, and classify threats using machine learning.
- Scikit-learn – ML models for anomaly detection and threat classification
- FastAPI – High-performance backend
- React.js + Tailwind CSS – Modern, interactive frontend
- Elasticsearch – Storage and query engine
- WebSockets – Live log stream updates
- Upload
.log
files and visualize security insights - Real-time detection of anomalies and threat types
- Dashboard with charts and live stream panel
- Time-based and threat/source filters
- Classic ML model pipeline (Isolation Forest + Gradient Boosting)
- Python 3.10+
- Node.js + npm
- Elasticsearch (installed locally or via Docker)
sudo dnf install elasticsearch
sudo systemctl enable --now elasticsearch
Or run via Docker:
docker run -d --name es -p 9200:9200 -e "discovery.type=single-node" elasticsearch:8.7.0
Clone the repository and run the setup script.
git clone https://github.com/yourusername/AI-Based-Security-Log-Analyzer.git
cd AI-Based-Security-Log-Analyzer
bash setup.sh
This will:
- Set up Python virtual environment
- Install all backend and ML dependencies
- Install frontend dependencies and build dashboard
- Start backend (port
8000
) and frontend (port5173
)
-
Visit
http://localhost:5173
in your browser -
Click “Upload .log File”
-
The system will:
- Parse and analyze logs
- Detect anomalies
- Classify threats
- Show insights in real-time
-
Use filters to explore logs
AI-Based-Security-Log-Analyzer/
├── backend_api/
│ ├── main.py
│ └── websocket_manager.py
│
├── ml_pipeline/
│ ├── train_isolation.py
│ ├── train_classic_model.py
│ ├── infer.py
│ └── preprocess.py
│
├── scripts/
│ └── bulk_upload_to_es.py
│
├── frontend_dashboard/
│ ├── src/App.jsx
│ └── components/LiveStream.jsx
│
├── data/ # Raw and parsed logs
├── models/ # ML .joblib models
├── setup.sh # Auto setup script
├── requirements.txt
└── README.md
Jun 14 15:16:02 combo sshd(pam_unix)[19937]: check pass; user unknown
Too many connections from 192.168.1.100
Failed login attempt for user root from 10.0.0.5
Run:
python tests/test_infer.py
- This is a local-first project – no login, no cloud.
- Elasticsearch must be running locally.
- Logs are streamed in real-time using WebSocket.
MIT License © 2025 \ AngadVM