A comprehensive log analysis tool that provides anomaly detection, timeline visualization, and AI-powered insights for log files.
- Log File Upload & Parsing: Support for Apache and SSH log formats
- Anomaly Detection: Automatic detection of suspicious patterns, error spikes, and unusual activities
- Timeline Visualization: Interactive charts showing log activity over time
- AI-Powered Analysis: OpenAI integration for intelligent log summaries and recommendations
- Real-time Investigation: View logs related to specific anomalies
- User Authentication: Secure login system with Supabase
- Python 3.8+
- Node.js 16+
- OpenAI API Key (for AI features)
-
Navigate to the backend directory:
cd log-analyzer/backend -
Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
SUPABASE_URL="your-supabase-url-here" SUPABASE_ANON_KEY="your-supabase-anon-key-here" SUPABASE_SERVICE_ROLE_KEY="your-supabase-service-key-here" SUPABASE_BUCKET="your-supabase-bucket-name-here" OPENAI_API_KEY="your_openai_api_key_here"
-
Navigate to the frontend directory:
cd log-analyzer/frontend -
Install dependencies:
npm install
-
Set up environment variables:
SUPABASE_URL="your-supabase-url-here" SUPABASE_ANON_KEY="your-supabase-anon-key-here" VITE_API_BASE_URL="your-backend-hosted-url"
From the log-analyzer/backend directory:
# Option 1: Use the run script
python3 run.py
# Option 2: Use Flask directly
FLASK_ENV=development DEBUG=true PORT=5001 python3 app.pyThe backend will start on http://localhost:5001
From the log-analyzer/frontend directory:
npm run devThe frontend will start on http://localhost:3000
- Login: Use the authentication system to access the application
- Upload Logs: Upload log files for analysis
- View Results: See detected anomalies, timeline charts, and AI-generated insights
- Investigate Anomalies: Click "Investigate" to see detailed information
- View Related Logs: Click "View Logs" to see logs related to specific anomalies
- Dismiss Notifications: Remove resolved or false positive anomalies
POST /api/auth/login- User authenticationPOST /api/upload/log- Log file upload and parsingPOST /api/analysis/analyze- Log analysis with AI insightsPOST /api/analysis/anomalies- Detailed anomaly analysisPOST /api/analysis/timeline- Timeline data for visualization
The application can be configured through environment variables:
OPENAI_API_KEY: Your OpenAI API key for AI featuresSUPABASE_URL: Supabase project URLSUPABASE_ANON_KEY: Supabase anonymous keyDEBUG: Enable debug modePORT: Backend server port
the Analysis summary feature leverages the OpenAI GPT-3.5-Turbo model to produce intelligent summaries, highlight key insights, and provide actionable recommendations based on log analysis data. If the OpenAI API request fails, the system gracefully falls back to a keyword-based analysis method, ensuring that summaries are still generated and other analysis features continue to function without interruption.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.