Skip to content

zrnge/LogLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”¬ LogLens 2.0

Don't spend money to analyze your logs. Do it all free, on your machine, locally β€” no data ever leaves your browser.

Live Demo No Backend Privacy AI Powered Single File No Tracking License Made with Love


LogLens is a universal log explorer that runs entirely in your browser. Drop any log file in, query it with KQL, visualize it on a timeline, and analyze it with a local AI β€” all without a single byte of your data touching the internet.

No servers. No SaaS. No subscriptions. Just open the HTML file.


✨ Features

πŸ” Powerful Query Engine

  • KQL syntax β€” level:ERROR AND service:auth*
  • Boolean logic β€” AND, OR, NOT, parentheses
  • Ranges β€” status_code:>=500, latency_ms:<=100
  • Wildcards β€” message:*timeout*, src_ip:10.0.*
  • Regex β€” message:/timeout|refused/i, src_ip:/^192\.168\./
  • Free text search β€” type anything, searches all fields

πŸ“Š Visualization

  • Timeline histogram β€” canvas-based, color-coded by log level
  • Drag to select a time range directly on the chart
  • Quick time filters β€” Last 5m / 30m / 1h / 6h / 24h / 7d / All
  • Custom from/to datetime pickers
  • Field value distribution bars (top-10 values per field, click to expand)

⚑ Performance

  • True virtual scroll β€” renders only visible rows, handles 500k+ logs without slowdown
  • Incremental loading β€” load multiple files, they merge automatically
  • Dedup mode β€” collapse repeated identical messages

πŸ“ Universal Format Support

Format Details
JSON / NDJSON Arrays and newline-delimited
CSV Auto-header detection, quoted fields
Syslog RFC 3164 β€” host proc[pid]: msg
Apache / Nginx Access logs + error logs
Log4j / Log4net timestamp [thread] LEVEL class - msg
CEF / LEEF Common/Log Event Extended Format
logfmt key=value key="quoted value"
GELF Graylog Extended Log Format
W3C / IIS #Fields: extended log format
Docker / k8s Timestamped container logs
Windows Event XML Exported from Event Viewer or PowerShell
.evtx binary Shows conversion guide with PowerShell/wevtutil commands
Plain text Any .log / .txt β€” every line becomes a row

πŸͺŸ Windows Event Logs (.evtx)

LogLens fully parses Windows XML Event Log format. For binary .evtx files, it detects the format and shows an instant conversion guide:

# Export to JSON (simplest)
Get-WinEvent -Path "C:\path\to\your.evtx" |
  Select-Object TimeCreated,Id,LevelDisplayName,Message,ProviderName,MachineName |
  ConvertTo-Json -Depth 3 | Out-File -Encoding UTF8 events.json

# Export to XML (preserves all fields β€” drop directly into LogLens)
$events = Get-WinEvent -Path "C:\path\to\your.evtx"
"<Events>" | Out-File events.xml -Encoding UTF8
$events | ForEach-Object { $_.ToXml() } | Out-File events.xml -Append -Encoding UTF8
"</Events>" | Out-File events.xml -Append -Encoding UTF8

πŸ€– Local AI Analyst

Zero-cost AI analysis. No API keys. No cloud. Everything stays on your machine.

Powered by Ollama, the AI panel lets you chat with your logs:

Action What it does
πŸ” Analyze Top errors, patterns, anomalies, cascading failures
πŸ“‹ Report Full incident report β€” summary, timeline, root cause, actions
πŸ’‘ KQL Hints Suggests 8-10 investigative queries you can apply with one click
πŸ”₯ Root Cause Identifies the most likely root cause from evidence in the logs
πŸ›‘ Security Audit Suspicious IPs, brute force, privilege escalation, exfiltration
πŸ“Š Stats Error rate, latency p95, volume trends, per-service breakdowns

AI is context-aware β€” injects your current filter, field names, level distribution, top errors, and up to 100 log sample entries into every request.

Context window control β€” choose 4K / 8K / 16K / 32K / 128K tokens and how many log entries to include. A live token meter shows usage and auto-prunes conversation history before overflow.

Stop button β€” abort mid-stream at any time. Partial responses are saved to context.

🧭 Navigation & UX

  • Keyboard-first β€” j/k rows, / search, m bookmark, c copy, d theme, ? help
  • Detail panel β€” Fields / Raw / JSON Tree tabs, prev/next row navigation
  • Column picker β€” choose exactly which columns to display (up to 12)
  • Resizable panels β€” drag handles on sidebar and detail panel
  • Saved queries β€” name and persist your favourite KQL queries
  • Query history β€” last 20 queries, one click to re-run
  • Bookmarks β€” star rows with m, filter to starred-only
  • Export β€” JSON or CSV of current filtered results
  • Share URL β€” encodes your query in #q=… hash, zero log data included
  • Light / Dark theme β€” persisted to localStorage

πŸš€ Quick Start

Option 1 β€” GitHub Pages (online, still 100% local)

Visit the live deployment. Everything runs in your browser β€” no data leaves your machine.

https://zrnge.github.io/LogLens/

Option 2 β€” Download and open locally (best for Ollama AI)

  1. Download LogLens.html
  2. Open it directly in your browser β€” no server needed
  3. Drop your log files in

Option 3 β€” Clone and use

git clone https://github.com/zrnge/LogLens.git
cd LogLens
# Just open LogLens.html in a browser
start LogLens.html       # Windows
open LogLens.html        # Mac
xdg-open LogLens.html    # Linux

πŸ€– Setting Up Ollama (Local AI)

  1. Install Ollama β€” ollama.com (free, Windows / Mac / Linux)

  2. Pull a model:

    ollama pull mistral        # default β€” fast, good quality (~4GB)
    ollama pull llama3.2       # great for analysis (~2GB)
    ollama pull deepseek-r1:7b # strong reasoning
    ollama pull phi3           # lightweight (~2GB)
  3. Start Ollama with CORS allowed (required for browser access):

    Windows CMD:

    set OLLAMA_ORIGINS=*&& ollama serve

    Windows PowerShell:

    $env:OLLAMA_ORIGINS="*"; ollama serve

    Mac / Linux:

    OLLAMA_ORIGINS=* ollama serve

    Tip (Windows): Set it permanently so you never need to think about it again:

    [System.Environment]::SetEnvironmentVariable("OLLAMA_ORIGINS","*","User")
  4. Click πŸ€– AI in LogLens β†’ Connect β†’ start asking questions


⌨️ Keyboard Shortcuts

Key Action
j / ↓ Next row
k / ↑ Previous row
Enter Open detail panel for selected row
Esc Close detail / modal
/ Focus search bar
Ctrl+Enter Run KQL query
m Bookmark selected row
c Copy selected row as JSON
w Toggle line wrap
d Toggle dark / light theme
t Toggle timeline
? Show keyboard help

πŸ’‘ KQL Query Examples

# All errors and criticals
level:ERROR OR level:CRITICAL

# HTTP server errors
status_code:>=500

# Failed authentication (wildcard)
message:*Invalid* OR message:*denied* OR message:*failed*

# Slow requests
latency_ms:>=1000

# Specific service in production
service:auth* AND env:production

# Regex β€” find IPs in a subnet
src_ip:/^192\.168\./

# Exclude health checks
NOT url:/health AND status_code:>=400

# Combine everything
level:ERROR AND service:api-gateway AND latency_ms:>=500 AND NOT method:OPTIONS

πŸ—οΈ Architecture

LogLens is intentionally a single HTML file (~2,500 lines). No build step, no npm, no dependencies, no CDN (except optional Google Fonts for the UI font β€” falls back to system monospace).

LogLens.html
β”œβ”€β”€ CSS (theme variables, virtual scroll, AI panel, modals)
β”œβ”€β”€ HTML (upload overlay, topbar, timeline, KQL bar, sidebar, log table, detail, AI panel)
└── JavaScript (pure vanilla ES2020)
    β”œβ”€β”€ Auto-parser (12 formats)
    β”œβ”€β”€ KQL engine (AND/OR/NOT/wildcards/ranges/regex)
    β”œβ”€β”€ Virtual scroll (26px fixed rows, buffer rendering)
    β”œβ”€β”€ Canvas timeline histogram
    β”œβ”€β”€ Ollama streaming chat client
    └── localStorage persistence (history, saved queries, theme)

Why a single file?

  • Zero setup for end users
  • Works offline once cached
  • Can be bookmarked, downloaded, and shared as a file attachment
  • Zero supply-chain risk

πŸ”’ Privacy Guarantee

LogLens is architecturally incapable of sending your data anywhere:

  • No fetch() calls to external servers (only to localhost:11434 for local Ollama)
  • No analytics, no tracking pixels, no beacons
  • No cookies (localStorage only, stays on your device)
  • No service workers that could cache and transmit data
  • Open source β€” read every line of the single HTML file yourself

πŸ‘¨β€πŸ’» Developer

Built by zrnge β€” open source, free forever.

GitHub LogLens Live


πŸ“„ License

MIT β€” free to use, modify, and distribute.


πŸ”¬ LogLens 2.0 β€” built by zrnge for engineers who believe their logs are their own business.

Don't spend money to analyze your logs. Do it all free, on your machine, locally β€” no data ever leaves your browser.

Star on GitHub

About

LogLens is a universal log explorer that runs entirely in your browser. Drop any log file in, query it with KQL, visualize it on a timeline, and analyze it with a local AI - all without a single byte of your data touching the internet.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages