Skip to content

Repository files navigation

SearXNG Log Viewer Logo

SearXNG Log Viewer

License: AGPL v3

A lightning-fast, privacy-first analytics dashboard for your SearXNG instance.

Docker Flask Python

Monitor local query logs, analyze hourly traffic, track IP sources, and keep the dashboard locked down by default.


📸 Preview

Dashboard View

Live-Einblick in Suchanfragen, Filter und geblockte Zugriffe.


✨ Key Features

  • 🏎️ Blazing Fast Parsing: Reverse-reads .jsonl files to ensure instant load times even with massive logs.
  • 🎨 Premium UI/UX: A modern, blur-styled dark interface built from scratch without bloated frontend frameworks.
  • 🔒 Secure by Default: HTTP Basic Auth is required unless explicitly disabled for local development.
  • 📊 Instant Analytics: Auto-calculates top 10 queries and generates UTC-based hourly distribution charts.
  • 💾 CSV Export: One-click data dumps of your current filtered view for deeper spreadsheet analysis.

⚙️ How it Works & Prerequisites

Out of the box, SearXNG does not generate structured query logs. This viewer requires your SearXNG instance to be configured (via patch or custom plugin) to write .jsonl files to a directory (e.g., /srv/searxng-query-logs).

Expected File Structure: Logs must be structured chronologically:

/srv/searxng-query-logs/
├── 2026/
│   ├── 07/
│   │   ├── 08/
│   │   │   └── query-2026-07-08.jsonl
│   │   └── 09/
│   │       └── query-2026-07-09.jsonl

Expected JSONL Format: Each line in the log file should be a valid JSON object like this:

{"ts_utc": "2026-07-09T03:00:00Z", "source_ip": "1.2.3.4", "method": "POST", "path": "/search", "query": "example query", "params": {}, "categories": ["general"]}

🚀 Quickstart (Docker)

The easiest way to deploy the Log Viewer is alongside your SearXNG Docker container. By default, the compose file binds the dashboard to 127.0.0.1:5000 so it is not exposed to the public network.

1. Clone & Configure

git clone https://github.com/Henner4746/searxng-log-viewer.git
cd searxng-log-viewer
cp .env.example .env

2. Edit .env

Adjust your settings in .env. The example password is intentionally rejected by the application; replace it with a real password before using the dashboard.

LOG_ROOT=/srv/searxng-query-logs
AUTH_USERNAME=admin
AUTH_PASSWORD=change-this-password
DISABLE_AUTH=false
ALLOWED_IP=1.2.3.4
DEFAULT_LIMIT=500
MAX_LIMIT=5000

3. Deploy

docker-compose up -d

The dashboard is now live at http://localhost:5000.

Do not expose this service directly to the internet unless it is behind HTTPS and a trusted authentication layer.


🔧 Environment Variables Reference

Variable Description Default
LOG_ROOT Absolute path to the root directory of your .jsonl logs. /srv/searxng-query-logs
AUTH_USERNAME Username for Basic Auth. Required unless DISABLE_AUTH=true. Empty
AUTH_PASSWORD Password for Basic Auth. Required unless DISABLE_AUTH=true. Empty
DISABLE_AUTH Explicitly disables Basic Auth. Use only for local development or behind another trusted auth layer. false
ALLOWED_IP An IP shortcut that enables the "Only IP-Shortcut" quick filter. Empty
DEFAULT_LIMIT Default number of lines parsed on initial load. 500
MAX_LIMIT Upper bound for the limit dropdown to prevent memory overload. 5000

Security and Privacy Notes

This dashboard displays SearXNG queries and source IP addresses. Treat the log directory and the dashboard as sensitive operational data.

  • Keep the service bound to 127.0.0.1 unless it is behind a reverse proxy with HTTPS and authentication.
  • Change the example password before first use.
  • Leave DISABLE_AUTH=false for normal deployments.
  • Mount the log directory read-only, as shown in docker-compose.yml.
  • Avoid storing query logs longer than necessary for your use case.

🛠️ Manual Development Setup

If you prefer to run it bare-metal or contribute to the code:

# Setup virtual environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the Flask app
python app.py

Built for privacy enthusiasts, self-hosters, and data nerds.

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details. This matches the official license used by the SearXNG project.

About

Secure local dashboard for SearXNG JSONL query logs

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages