Skip to content

asnaassalam/log-lens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Log-Lens

Streamlit App

Log-Lens is a high-performance, zero-dependency log analysis dashboard designed to help developers troubleshoot system crashes quickly and efficiently. Built entirely in Python using Streamlit, Pandas, and Plotly, it provides powerful parsing and visualization tools without requiring external AI APIs.


✨ Features

  • Smart File Ingestion: Drag-and-drop uploader supporting .log, .txt, and .csv formats.
  • Auto-Parsing: Built-in Regex engine automatically extracts Timestamp, Level, and Message from raw log lines.
  • Diagnostic Dashboard:
    • High-level KPI Metrics (Total logs, Total errors, Most frequent errors).
    • Interactive Plotly Error Heatmap showing log frequency over time, color-coded by severity.
  • Advanced Triage Tools:
    • Deduplication: "Cluster Similar Errors" feature groups repeating logs (e.g., masking UUIDs, IPs, and Hex values) to reduce noise.
    • Live Filtering: Sidebar multi-select for Log Levels and an interactive Date/Time range slider.
    • Search: Deep-dive search bar supporting both plain text and Regex patterns.
  • Utility & Export: Clean data tables with "ERROR" row syntax highlighting and 1-click CSV export functionality.
  • Terminal Aesthetic: Custom dark-mode Streamlit theme optimized for performance on large files.

πŸ’‘ How to Use

  1. Upload Logs: Drag and drop any .log, .txt, or .csv file into the sidebar uploader. (Sample logs are provided in the test_logs/ folder!)
  2. Filter Data: Use the Log Level checkboxes or the interactive Date/Time slider to narrow down the timeframe.
  3. Regex Search: Check "Use Regex" to perform powerful pattern matching (e.g., HTTP 50[0-9] or \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} for IPs).
  4. Cluster Errors: Switch to the "Clustered Errors" tab to instantly group repeating error patterns and remove the noise.

πŸ› οΈ Tech Stack

  • Frontend / Backend Framework: Streamlit
  • Data Processing: Pandas
  • Visualization: Plotly
  • Containerization: Docker (Optimized slim Python image for Google Cloud Run)

πŸ“ Project Structure

loglens/
β”œβ”€β”€ .streamlit/
β”‚   └── config.toml         # Custom Dark Mode theme configuration
β”œβ”€β”€ src/                    # Core backend logic
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ dashboard.py        # KPI metrics and Plotly heatmap generation
β”‚   β”œβ”€β”€ log_parser.py       # Regex auto-detection and Pandas ingestion
β”‚   └── triage.py           # Deduplication clustering and filtering
β”œβ”€β”€ app.py                  # Main Streamlit application entry point
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ Dockerfile              # Container configuration for deployment
└── test_logs/              # Sample log files for testing

πŸš€ Getting Started Locally

Prerequisites

  • Python 3.11+
  • pip

Installation

  1. Clone the repository:

    git clone https://github.com/asnaassalam/log-lens.git
    cd log-lens
  2. (Optional) Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the application:

    streamlit run app.py
  5. Start Analyzing! Open http://localhost:8501 in your browser and upload any file from the test_logs/ directory to see the dashboard in action.

☁️ Deployment (Google Cloud Run)

Log-Lens is optimized to run as a serverless container on Google Cloud Run.

  1. Build the container:

    docker build -t log-lens:latest .
  2. Run locally via Docker (optional):

    docker run -p 8501:8501 log-lens:latest
  3. Deploy to Google Cloud Run: Assuming you have the gcloud CLI installed and authenticated:

    gcloud run deploy log-lens \
      --source . \
      --allow-unauthenticated \
      --region <your-region>

Built with ❀️ for rapid log triage and troubleshooting. Co-created with the Antigravity AI Agent.

About

πŸ” High-performance log analysis dashboard built with Streamlit & Pandas. Fast regex auto-parsing, interactive Plotly heatmaps, and smart error clustering for rapid system troubleshooting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors