{"id":46282079,"url":"https://github.com/ranjan-mohanty/logai","last_synced_at":"2026-03-04T06:03:09.512Z","repository":{"id":324895948,"uuid":"1097887864","full_name":"ranjan-mohanty/logai","owner":"ranjan-mohanty","description":"🤖 AI-powered log analysis tool - Parse, group, and understand your logs with intelligent error detection and automated insights","archived":false,"fork":false,"pushed_at":"2025-12-16T08:15:20.000Z","size":419,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T18:28:08.096Z","etag":null,"topics":["ai","analysis","error-analysis","log-analysis","logging"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ranjan-mohanty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["ranjan-mohanty"]}},"created_at":"2025-11-17T01:29:31.000Z","updated_at":"2025-12-16T08:15:18.000Z","dependencies_parsed_at":"2025-12-16T12:06:05.134Z","dependency_job_id":null,"html_url":"https://github.com/ranjan-mohanty/logai","commit_stats":null,"previous_names":["ranjan-mohanty/logai"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ranjan-mohanty/logai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranjan-mohanty%2Flogai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranjan-mohanty%2Flogai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranjan-mohanty%2Flogai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranjan-mohanty%2Flogai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ranjan-mohanty","download_url":"https://codeload.github.com/ranjan-mohanty/logai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranjan-mohanty%2Flogai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30073690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","analysis","error-analysis","log-analysis","logging"],"created_at":"2026-03-04T06:03:08.801Z","updated_at":"2026-03-04T06:03:09.502Z","avatar_url":"https://github.com/ranjan-mohanty.png","language":"Rust","funding_links":["https://github.com/sponsors/ranjan-mohanty"],"categories":[],"sub_categories":[],"readme":"# 🤖 LogAI\n\n[![CI](https://github.com/ranjan-mohanty/logai/workflows/CI/badge.svg)](https://github.com/ranjan-mohanty/logai/actions)\n[![Release](https://github.com/ranjan-mohanty/logai/workflows/Release/badge.svg)](https://github.com/ranjan-mohanty/logai/actions/workflows/release.yml)\n[![codecov](https://codecov.io/gh/ranjan-mohanty/logai/branch/main/graph/badge.svg)](https://codecov.io/gh/ranjan-mohanty/logai)\n[![Crates.io](https://img.shields.io/crates/v/logai.svg)](https://crates.io/crates/logai)\n[![Downloads](https://img.shields.io/crates/d/logai.svg)](https://crates.io/crates/logai)\n[![GitHub Release](https://img.shields.io/github/v/release/ranjan-mohanty/logai)](https://github.com/ranjan-mohanty/logai/releases/latest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Rust Version](https://img.shields.io/badge/rust-1.70%2B-blue.svg)](https://www.rust-lang.org)\n[![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey.svg)](https://github.com/ranjan-mohanty/logai/releases/latest)\n\n**AI-powered log analysis** - Parse, group, and understand your logs with AI.\n\nLogAI analyzes your application logs, groups similar errors, and uses AI to\nexplain what went wrong and how to fix it.\n\n## What is LogAI?\n\nLogAI is a CLI tool that analyzes application logs, groups similar errors, and\nprovides intelligent suggestions for fixing issues. Stop manually searching\nthrough massive log files and let LogAI do the detective work.\n\n## Features\n\n### 🔍 **Log Analysis \u0026 Parsing**\n\n✅ **Multiple log formats** - JSON, plain text, Apache, Nginx, Syslog  \n✅ **Auto-detect log format** - Automatically identifies format from content  \n✅ **Smart error grouping** - Pattern-based clustering with dynamic value\nnormalization  \n✅ **Multiline log support** - Stack traces, JSON objects, and continuation\nlines  \n✅ **Metadata extraction** - File paths, line numbers, function names, request\nIDs  \n✅ **Parallel processing** - Multi-threaded parsing for large files  \n✅ **Streaming support** - Process logs from stdin or pipes\n\n### 🤖 **AI-Powered Intelligence**\n\n✅ **Multiple AI providers** - OpenAI, Claude, Gemini, Ollama, AWS Bedrock  \n✅ **Parallel AI analysis** - Process multiple errors concurrently (5x faster)  \n✅ **Automatic retry** - Exponential backoff for transient failures  \n✅ **Response caching** - Reduce API costs with intelligent caching  \n✅ **Solution suggestions** - Code examples and fix recommendations  \n✅ **Configurable concurrency** - Control API request rate (1-20 concurrent)  \n✅ **Progress tracking** - Real-time analysis progress with ETA\n\n### 📊 **Output \u0026 Reporting**\n\n✅ **Beautiful terminal output** - Color-coded, formatted results  \n✅ **HTML reports** - Interactive web reports with charts and filtering  \n✅ **JSON output** - Machine-readable format for automation  \n✅ **Statistics mode** - Detailed metrics and analysis summaries  \n✅ **Flexible formatting** - Customizable output templates  \n✅ **Error frequency tracking** - Time-based occurrence patterns\n\n### ⚙️ **Configuration \u0026 Integration**\n\n✅ **Configuration file** - TOML-based settings with profiles  \n✅ **MCP (Model Context Protocol)** - Connect external tools and data sources  \n✅ **Environment variables** - Flexible configuration options  \n✅ **CLI argument validation** - Comprehensive input validation  \n✅ **Cross-platform support** - Linux, macOS, Windows  \n✅ **CI/CD friendly** - Exit codes and automation support\n\n### 🛠️ **Developer Experience**\n\n✅ **Comprehensive testing** - 166+ unit tests with high coverage  \n✅ **Clean command** - Manage generated reports and logs  \n✅ **Verbose logging** - Debug mode for troubleshooting  \n✅ **Error handling** - Graceful degradation and informative errors  \n✅ **Performance optimization** - Memory-efficient processing  \n✅ **Documentation** - Extensive guides and examples\n\n## Coming Soon\n\n### 🚀 **Enhanced Analysis**\n\n🚧 **Anomaly detection** - Identify unusual patterns and outliers  \n🚧 **Trend analysis** - Historical pattern recognition  \n🚧 **Custom log formats** - User-defined parsing rules  \n🚧 **Log correlation** - Cross-service error tracking  \n🚧 **Performance metrics** - Response time and throughput analysis\n\n### 🔧 **Built-in MCP Tools**\n\n🚧 **search_docs** - Search documentation and knowledge bases  \n🚧 **check_metrics** - Query monitoring systems (Prometheus, DataDog)  \n🚧 **search_code** - Search codebases for related issues  \n🚧 **query_logs** - Search log aggregation systems (ELK, Splunk)  \n🚧 **check_status** - Query service health endpoints\n\n### 📈 **Advanced Features**\n\n🚧 **Watch mode** - Real-time log monitoring and analysis  \n🚧 **Dashboard mode** - Live updating web interface  \n🚧 **Alert integration** - Slack, PagerDuty, webhook notifications  \n🚧 **Log shipping** - Direct integration with log collectors  \n🚧 **Machine learning** - Custom model training for specific domains\n\n### 🌐 **Enterprise Features**\n\n🚧 **Team collaboration** - Shared analysis and annotations  \n🚧 **Role-based access** - User permissions and audit logs  \n🚧 **API server mode** - REST API for programmatic access  \n🚧 **Database storage** - Persistent analysis history  \n🚧 **SSO integration** - Enterprise authentication support\n\n## Quick Start\n\n## Installation\n\n### Quick Install (macOS/Linux)\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/ranjan-mohanty/logai/main/scripts/install.sh | bash\n```\n\n### Homebrew (macOS/Linux)\n\n```bash\nbrew install https://raw.githubusercontent.com/ranjan-mohanty/logai/main/scripts/homebrew/logai.rb\n```\n\n### Cargo (All platforms)\n\n```bash\ncargo install logai\n```\n\n### Pre-built Binaries\n\nDownload from\n[GitHub Releases](https://github.com/ranjan-mohanty/logai/releases/latest):\n\n- macOS (Intel \u0026 Apple Silicon)\n- Linux (x86_64 \u0026 ARM64)\n  - Standard: `logai-linux-x86_64.tar.gz` (Ubuntu 22.04+, RHEL 9+, AL2023)\n  - Musl: `logai-linux-x86_64-musl.tar.gz` (Amazon Linux 2, Ubuntu 20.04+,\n    CentOS 7+, any Linux)\n- Windows (x86_64)\n\n**Amazon Linux 2:**\n\n```bash\nwget https://github.com/ranjan-mohanty/logai/releases/latest/download/logai-linux-x86_64-musl.tar.gz\ntar -xzf logai-linux-x86_64-musl.tar.gz\nsudo mv logai /usr/local/bin/\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/ranjan-mohanty/logai.git\ncd logai\ncargo install --path .\n```\n\n## Usage\n\nAnalyze a log file:\n\n```bash\nlogai investigate app.log\n```\n\nAnalyze multiple files:\n\n```bash\nlogai investigate app.log error.log\n```\n\nPipe logs from stdin:\n\n```bash\ntail -f app.log | logai investigate -\ncat error.log | logai investigate -\n```\n\nLimit output:\n\n```bash\nlogai investigate app.log --limit 10\n```\n\nJSON output:\n\n```bash\nlogai investigate app.log --format json\n```\n\nInteractive HTML report:\n\n```bash\nlogai investigate app.log --format html \u003e report.html\n# With AI analysis\nlogai investigate app.log --ai bedrock --format html \u003e report.html\n```\n\nEnable verbose/debug logging:\n\n```bash\nlogai --verbose investigate app.log\n# or\nlogai -v investigate app.log --ai bedrock\n```\n\n## AI-Powered Analysis\n\nAnalyze with OpenAI:\n\n```bash\nexport OPENAI_API_KEY=sk-...\nlogai investigate app.log --ai openai\nlogai investigate app.log --ai openai --model gpt-4\n```\n\nAnalyze with Claude:\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\nlogai investigate app.log --ai claude\nlogai investigate app.log --ai claude --model claude-3-5-sonnet-20241022\n```\n\nAnalyze with Gemini:\n\n```bash\nexport GEMINI_API_KEY=...\nlogai investigate app.log --ai gemini\nlogai investigate app.log --ai gemini --model gemini-1.5-pro\n```\n\nAnalyze with Ollama (local, free):\n\n```bash\n# Make sure Ollama is running: ollama serve\nlogai investigate app.log --ai ollama\nlogai investigate app.log --ai ollama --model llama3.2\n```\n\nAnalyze with AWS Bedrock:\n\n```bash\n# With region flag (recommended)\nlogai investigate app.log --ai bedrock --region us-east-1\n\n# With specific model\nlogai investigate app.log --ai bedrock --region us-east-1 --model anthropic.claude-3-haiku-20240307-v1:0\n\n# Or set region via environment variable\nexport AWS_REGION=us-east-1\nlogai investigate app.log --ai bedrock\n```\n\nDisable caching (force fresh analysis):\n\n```bash\nlogai investigate app.log --ai openai --no-cache\n```\n\n### Parallel Analysis\n\nLogAI processes error groups in parallel for faster analysis. Control\nconcurrency:\n\n```bash\n# Default: 5 concurrent requests\nlogai investigate app.log --ai ollama\n\n# High concurrency (faster, more resources)\nlogai investigate app.log --ai ollama --concurrency 15\n\n# Low concurrency (slower, less resources)\nlogai investigate app.log --ai ollama --concurrency 2\n\n# Sequential processing\nlogai investigate app.log --ai ollama --concurrency 1\n```\n\n**Performance comparison** (100 error groups):\n\n- Sequential (concurrency=1): ~25 minutes\n- Default (concurrency=5): ~5 minutes\n- High (concurrency=15): ~2 minutes\n\n### Configuration File\n\nCreate `~/.logai/config.toml` to set defaults:\n\n```toml\n# AI Settings\n[ai]\nprovider = \"ollama\"  # Default AI provider\n\n# Analysis settings\n[analysis]\nmax_concurrency = 5        # Concurrent AI requests (1-20)\nenable_retry = true        # Retry failed requests\nmax_retries = 3            # Maximum retry attempts\ninitial_backoff_ms = 1000  # Initial retry delay\nmax_backoff_ms = 30000     # Maximum retry delay\nenable_cache = true        # Cache AI responses\ntruncate_length = 2000     # Max message length\n\n# Provider configurations\n[providers.ollama]\nenabled = true\nmodel = \"llama3.2\"\nhost = \"http://localhost:11434\"\n\n[providers.openai]\nenabled = false\n# api_key = \"sk-...\"  # Or use OPENAI_API_KEY env var\n# model = \"gpt-4\"\n```\n\n**Configuration examples:**\n\nHigh-performance (self-hosted Ollama):\n\n```toml\n[analysis]\nmax_concurrency = 15\nmax_retries = 2\ninitial_backoff_ms = 500\n```\n\nConservative (API rate limits):\n\n```toml\n[analysis]\nmax_concurrency = 2\nmax_retries = 5\ninitial_backoff_ms = 2000\nmax_backoff_ms = 60000\n```\n\nFast-fail (development):\n\n```toml\n[analysis]\nmax_concurrency = 10\nenable_retry = false\n```\n\n## MCP Integration (Advanced)\n\nLogAI supports [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)\nto connect external tools and data sources during analysis.\n\nCreate `~/.logai/mcp.toml`:\n\n```toml\ndefault_timeout = 30\n\n[[servers]]\nname = \"filesystem\"\nenabled = true\n\n[servers.connection]\ntype = \"Stdio\"\ncommand = \"npx\"\nargs = [\"-y\", \"@modelcontextprotocol/server-filesystem\", \"/tmp\"]\n```\n\nUse with MCP tools:\n\n```bash\nlogai investigate app.log --ai ollama --mcp-config ~/.logai/mcp.toml\n```\n\nDisable MCP:\n\n```bash\nlogai investigate app.log --ai ollama --no-mcp\n```\n\nSee [MCP Integration Guide](docs/MCP_INTEGRATION.md) for more details.\n\n## Example Output\n\n```text\n🤖 LogAI Analysis Report\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n📊 Summary\n   Errors found: 3 unique patterns (9 occurrences)\n   Time range: 2025-11-17 10:30:00 - 2025-11-17 10:35:00\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n🔴 Critical: Connection failed to database (3 occurrences)\n   First seen: 5 minutes ago | Last seen: 4 minutes ago\n\n   📋 Example:\n   Connection failed to database\n   📍 Location: db.rs:42\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n🔴 Critical: Timeout waiting for response from \u003cDYNAMIC\u003e (3 occurrences)\n   First seen: 1 minute ago | Last seen: 30 seconds ago\n\n   📋 Example:\n   Timeout waiting for response from api.example.com\n```\n\n## Supported Log Formats\n\n- **JSON logs** - Structured logs with fields like `level`, `message`,\n  `timestamp`\n- **Plain text logs** - Traditional text logs with timestamps and severity\n  levels\n- **Apache logs** - Apache HTTP server access and error logs (Common and\n  Combined formats)\n- **Nginx logs** - Nginx web server access and error logs\n- **Syslog** - System logs in RFC3164 and RFC5424 formats\n- **Auto-detection** - Automatically detects format from log content\n\n## Development\n\nBuild:\n\n```bash\ncargo build\n```\n\nRun tests:\n\n```bash\ncargo test\n```\n\nRun with sample logs:\n\n```bash\ncargo run -- investigate tests/fixtures/sample.log\n```\n\n## Supported AI Providers\n\n| Provider    | Models                   | Cost | Speed  | Setup            |\n| ----------- | ------------------------ | ---- | ------ | ---------------- |\n| **OpenAI**  | GPT-4, GPT-4o-mini       | Paid | Fast   | API key required |\n| **Claude**  | Claude 3.5 Sonnet/Haiku  | Paid | Fast   | API key required |\n| **Gemini**  | Gemini 1.5 Flash/Pro     | Paid | Fast   | API key required |\n| **Bedrock** | Claude, Llama, Titan     | Paid | Fast   | AWS credentials  |\n| **Ollama**  | Llama 3.2, Mistral, etc. | Free | Medium | Local install    |\n\n## How It Works\n\n1. **Parse** - Automatically detects log format (JSON, plain text)\n2. **Group** - Clusters similar errors by normalizing dynamic values\n3. **Deduplicate** - Shows unique patterns with occurrence counts\n4. **Analyze** - Uses AI to explain errors and suggest fixes (optional)\n   - Processes multiple error groups in parallel (configurable concurrency)\n   - Automatic retry with exponential backoff for transient failures\n   - Real-time progress tracking with throughput and ETA\n5. **Cache** - Stores AI responses locally to reduce costs\n\n## Roadmap\n\n### ✅ **Completed (v0.1.x)**\n\n- [x] Core parsing and grouping with smart pattern recognition\n- [x] Multi-format support (JSON, plain text, Apache, Nginx, Syslog)\n- [x] AI integration (OpenAI, Claude, Gemini, Ollama, AWS Bedrock)\n- [x] Parallel processing and concurrent AI analysis\n- [x] Response caching and retry mechanisms\n- [x] HTML and JSON output formats\n- [x] MCP (Model Context Protocol) integration\n- [x] Comprehensive configuration system\n- [x] Cross-platform support and CI/CD compatibility\n\n### 🚧 **In Progress (v0.2.x)**\n\n- [ ] Built-in MCP tools (search_docs, check_metrics, search_code)\n- [ ] Enhanced error correlation and pattern analysis\n- [ ] Performance optimizations for large log files\n- [ ] Advanced filtering and search capabilities\n\n### 🎯 **Planned (v0.3.x)**\n\n- [ ] Watch mode for real-time log monitoring\n- [ ] Dashboard web interface with live updates\n- [ ] Anomaly detection using statistical analysis\n- [ ] Custom log format definitions\n- [ ] Alert and notification integrations\n\n### 🌟 **Future (v1.0+)**\n\n- [ ] Machine learning for domain-specific analysis\n- [ ] Enterprise features (SSO, RBAC, audit logs)\n- [ ] API server mode for programmatic access\n- [ ] Team collaboration and shared analysis\n- [ ] Advanced visualization and reporting\n\n## Documentation\n\n### Getting Started\n\n- **[Quick Start Guide](docs/QUICK_START.md)** - Get up and running in 5 minutes\n- **[Usage Guide](docs/USAGE.md)** - Comprehensive usage examples\n- **[Examples](examples/)** - Sample logs and real-world scenarios\n- **[FAQ](docs/FAQ.md)** - Frequently asked questions\n\n### For Developers\n\n- **[Architecture](docs/ARCHITECTURE.md)** - System design and architecture\n- **[API Documentation](docs/API.md)** - Using LogAI as a library\n- **[Development Guide](docs/DEVELOPMENT.md)** - Setting up development\n  environment\n- **[Contributing](CONTRIBUTING.md)** - How to contribute to the project\n\n### Operations\n\n- **[Deployment Guide](docs/DEPLOYMENT.md)** - Production deployment strategies\n- **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions\n- **[Security Policy](SECURITY.md)** - Security best practices and reporting\n\n### Reference\n\n- **[Compatibility](docs/COMPATIBILITY.md)** - Supported log formats\n- **[Changelog](CHANGELOG.md)** - Version history\n- **[MCP Integration](docs/MCP_INTEGRATION.md)** - Model Context Protocol guide\n\n### Community\n\n- **[Contributors](CONTRIBUTORS.md)** - Recognition for contributors\n- **[Maintainers](MAINTAINERS.md)** - Project maintainers and governance\n\n## Contributing\n\nContributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md)\nand [Code of Conduct](CODE_OF_CONDUCT.md).\n\n## Future Plans\n\nSee [GitHub Issues](https://github.com/ranjan-mohanty/logai/issues) for planned\nfeatures and known issues.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file\n\n## Author\n\nBuilt with ❤️ by [Ranjan Mohanty](https://github.com/ranjan-mohanty)\n\n## Acknowledgments\n\n- Inspired by the need for better log debugging tools\n- Thanks to all AI providers for making this possible\n- Built with Rust 🦀\n\n## Star History\n\nIf you find LogAI useful, please consider giving it a star ⭐\n\n## Support\n\n- 🐛\n  [Report a bug](https://github.com/ranjan-mohanty/logai/issues/new?labels=bug)\n- 💡\n  [Request a feature](https://github.com/ranjan-mohanty/logai/issues/new?labels=enhancement)\n- 💬 [Start a discussion](https://github.com/ranjan-mohanty/logai/discussions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franjan-mohanty%2Flogai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Franjan-mohanty%2Flogai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franjan-mohanty%2Flogai/lists"}