内容
# 🧠 AI Log Analyzer
[](https://www.python.org/)
[](https://fastapi.tiangolo.com/)
[](https://ollama.com/)
[](LICENSE)
> ✨ An AI-powered system for **log file analysis** using local LLaMA3 + FastAPI.
> 🚨 Detects anomalies, 🧠 recognizes patterns, and 📄 generates automated incident reports.
> Ideal for **web server logs**, **application logs**, or **custom pipelines**.
---
## 🎯 Features
- 🔍 **Anomaly Detection** – Captures HTTP errors, exceptions, and unusual logs
- 📊 **Pattern Recognition** – Identifies frequent paths/messages
- 🤖 **AI Chatbot Interface** – Interact via terminal CLI using LLaMA3 (Ollama)
- ⚡ **FastAPI REST API** – Query `/analyze` for real-time results
- 📁 **JSON Report Export** – Auto-generated `incident_report.json`
---
<details>
<summary>📁 <strong>Project Structure</strong> (click to expand)</summary>
ai-log-analyzer/
├── main/
│ ├── log_chatbot.py # Interactive CLI chatbot
│ ├── run_pipeline.py # Main execution pipeline
│ ├── llama_query.py # Talk to LLaMA locally
│ ├── mcp_server.py # FastAPI app for RESTful analysis
│ ├── report_generator.py # Saves JSON report
│ ├── anomaly_detector.py # Anomaly rules (500, error)
│ ├── pattern_recognizer.py # Pattern recognition logic
│ └── mcp_tools/
│ ├── parser.py # Raw log parser
│ └── analyzer.py # Combined logic
├── logs/ # Example log files
├── output/ # Generated reports
├── requirements.txt
└── README.md
</details>
---
## ⚙️ Installation
```bash
git clone https://github.com/Labeeb-coder/ai-log-analyzer.git
cd ai-log-analyzer
pip install -r requirements.txt
连接信息
猜你喜欢
MarkItDown MCP
MarkItDown-MCP是一个轻量级服务器,用于将URI转换为Markdown。
MarkItDown
将文件和办公文档转换为Markdown的Python工具。
OmniRoute
永不停息的编码。免费 AI 网关 — 一个端点,160+ 提供商,零停机时间。智能 4 级自动降级(订阅 → API → 廉价 →...
OpenInsider-MCP
将openinsider.com暴露给任何MCP兼容客户端的MCP服务器。
ppt-mcp
世界一流的 PowerPoint MCP 服务器 - 通过 COM 自动化实现 PowerPoint 实时控制
log-mcp
用于日志文件分析的 MCP 服务器