Sign inSign up

loglensai/loglens

By loglensai

โ€ขUpdated 2 months ago

Image
Security
Machine learning & AI
Monitoring & observability
0

375

loglensai/loglens repository overview

โ LogLens AI - Local, Explainable Log Anomaly Detection ๐Ÿ”

The self-hosted, AI-powered alternative to Splunk & Datadog for log anomaly detection. Finds real incidents by meaning, explains why in plain English, groups them into incident families, watches your containers live, and alerts you Sentry-style - 100% local, $0/GB, zero setup.

PyPI License: MIT Website Multi-arch

docker run --rm -v "$PWD:/data" loglensai/loglens analyze --source app.log

First real insight in seconds - no account, no agent, no cloud, no bill.


โ โšก Why teams pull LogLens AI

Traditional log platforms hand you a score and an invoice. LogLens AI hands you answers - and runs entirely on your own box.

LogLens AISplunkDatadogElastic ML
๐Ÿ’ฐ Cost$0 / GB~$150/GB/yr~$0.10โ€“1.27/GBlicense
โฑ๏ธ Setup timesecondsdaysโ€“weekshoursโ€“dayshours
๐Ÿ”’ Runs offline / air-gappedโœ…partialโŒpartial
๐Ÿ“Š Published, reproducible accuracyโœ… F1 0.957โŒโŒโŒ
๐Ÿ’ฌ Explains why a line is anomalousโœ…scores onlyscores onlyscores only
๐Ÿงฉ Groups repeats into incidentsโœ…partialpartialโŒ
๐Ÿ‘€ Live watch (docker/k8s/journald)โœ…โœ…โœ…partial
๐Ÿšจ Self-alerting in 1 line of codeโœ…โŒagentโŒ
๐Ÿค– AI root-cause narrativesโœ…paid add-onpaidโŒ

โ ๐Ÿ“Š Proven accuracy - run it yourself

Measured on real, labeled production logs (Loghub BGL: 500,000 lines, 206,847 alerts). Fully reproducible with the built-in benchmark command - don't trust us, verify it.

ModePrecisionRecallF1SpeedMissed alerts
โšก fast0.9011.0000.948~6,700 l/s0
๐Ÿš€ turbo0.9011.0000.948~7,300 l/s0
๐Ÿง  deep (AI)0.9171.0000.957~3,400 l/s0
  • ๐ŸŽฏ Zero missed alerts - 1.000 recall across all 206,847 incidents, every mode.
  • ๐Ÿงช 30/30 injected incidents caught across 6 log formats - 100% recall, zero config.
  • ๐Ÿ›ก๏ธ 99.3% specificity on 500k all-normal lines (no retuning) - it doesn't cry wolf.

โ ๐Ÿš€ Quick start

Analyze a log file (mount the folder that holds it at /data):

docker run --rm -v "$PWD:/data" loglensai/loglens analyze --source app.log

Turbo scan + AI root-cause + shareable offline HTML report:

docker run --rm -v "$PWD:/data" \
  -e LOGLENS_LLM_PROVIDER=openai -e LOGLENS_LLM_API_KEY=sk-... \
  loglensai/loglens analyze --source app.log --turbo --rca --html report.html

Ask your logs a question in plain English:

docker run --rm -v "$PWD:/data" \
  -e LOGLENS_LLM_PROVIDER=openai -e LOGLENS_LLM_API_KEY=sk-... \
  loglensai/loglens ask "why did the payment service start timing out?" --source app.log

Everything after the image name goes straight to the CLI - explore it all with:

docker run --rm loglensai/loglens --help

โ ๐Ÿ‘€ Live incident feed for your running containers

Watch any container's logs and surface only the problems, the instant they happen - CRITICAL/FATAL lines appear immediately, noise is filtered out:

docker run --rm \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  loglensai/loglens watch "docker logs -f my-api" --rca

Ctrl-C prints an incident summary card - plus an AI root-cause story with --rca. Works with kubectl logs -f and journalctl -f too.


โ ๐Ÿšจ Sentry-style alerts to Slack / Teams / Email

Point LogLens at a service and get an alert - with a one-line root cause - the moment something breaks, including uncaught crashes. De-duplicated and rate-limited, so an error storm becomes one alert, not five hundred:

docker run --rm \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -e LOGLENS_SLACK_WEBHOOK=https://hooks.slack.com/services/XXX/YYY/ZZZ \
  loglensai/loglens watch "docker logs -f my-api" --rca
๐Ÿ”ด [my-api] CRITICAL ยท db (score 0.95)
database connection refused during checkout
โ†ณ likely cause: a dependency is down or refusing connections (seen in db)

Channel & AI environment variables:

# Alerts (configure any/all)
LOGLENS_SLACK_WEBHOOK
LOGLENS_TEAMS_WEBHOOK
LOGLENS_EMAIL_SMTP_HOST / _SMTP_PORT / _USER / _PASSWORD / _TO

# Optional LLM - enriches root-cause (BYO key; only grouped summaries sent, never full logs)
LOGLENS_LLM_PROVIDER   openai | azure | groq
LOGLENS_LLM_MODEL
LOGLENS_LLM_API_KEY

โ ๐Ÿท๏ธ Image tags

TagContentsBest for
latest, 0.3, 0.3.1fast + turbo detection, live watch, alerts, SDK, ask, RCA, HTML reportsmost users
deepeverything above + neural (transformer) semantic mode for best precisionhighest accuracy

Every image is multi-architecture - linux/amd64 and linux/arm64 (Apple Silicon, AWS Graviton, Raspberry Pi).

docker run --rm -v "$PWD:/data" loglensai/loglens:deep analyze --source app.log --deep

โ ๐Ÿ™ One-shot & always-on with Compose

services:
  watch:
    image: loglensai/loglens:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./logs:/data
    env_file: [ .env ]        # Slack/Teams/Email + optional LLM key
    command: ["watch", "docker logs -f my-api", "--rca"]
    restart: unless-stopped

โ โœจ What's inside

  • ๐Ÿง  Three detection engines, one unified score - statistical fast, throughput-tuned turbo, and transformer-based deep.
  • ๐Ÿงฉ Incident grouping - 200 identical errors collapse into one incident family with an ร—N count.
  • ๐Ÿ’ฌ Explainable by default - every anomaly ships with a plain-language reason, not just a number.
  • ๐Ÿ“„ 10+ log formats auto-detected - Apache, Linux, HDFS, Spark, Zookeeper, OpenStack, Thunderbird, BGL, HealthApp & more. Zero config.
  • ๐Ÿ Full Python SDK - analyze(), LiveDetector, drop-in logging handler, .rca() / .ask() / .save_html().
  • ๐Ÿ“ˆ Self-contained offline HTML dashboards - dark-themed, no CDN, embeds the AI root-cause narrative.
  • ๐Ÿ”’ Private & air-gap friendly - detection never leaves the container.

โ ๐Ÿ›ก๏ธ Enterprise-ready by design

  • Runs as a non-root user, minimal Python-slim base, small attack surface.
  • Multi-arch signed builds published via CI on every tagged release.
  • No telemetry, no phone-home - your logs stay yours.
  • /data volume for inputs and cached models; stateless and reproducible.
  • MIT licensed - use it in production, commercially, anywhere.

Website: https://loglensai.comโ  ยท Docs: https://loglensai.com/docsโ  ยท PyPI: https://pypi.org/project/loglensai/โ  ยท Source: https://github.com/ParasRajput810/LogLens-AIโ 

log anomaly detection ยท AI log analysis ยท self-hosted log monitoring ยท Splunk alternative ยท Datadog alternative ยท open-source observability ยท root cause analysis ยท SRE / DevOps tooling ยท container log monitoring ยท Kubernetes log analysis ยท Sentry for logs ยท air-gapped log analytics ยท incident detection ยท MIT licensed


โญ If LogLens AI saves you a 2 a.m. page, star the repo and share the pull.

docker pull loglensai/loglens ยท MIT ยท Built for engineers, by engineers.

Tag summary

Content type

Image

Digest

sha256:2541dbfa1โ€ฆ

Size

204.4 MB

Last updated

2 months ago

docker pull loglensai/loglens