Skip to content
gitarnsPublic

About

Quickwit frontend

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Repository files navigation

qwui

Logs view Visualize view Traces view

A Kibana-like log explorer UI for Quickwit. React frontend, Rust backend, OIDC support, and a read-only MCP endpoint for AI agents.

Architecture

Browser
  └── Vite dev server (port 5173) or built static files
        └── /api/*       → qwui backend (port 8080)
        └── /quickwit/*  → qwui backend (port 8080)
              └── proxies to Quickwit (port 7280)

AI agent
  └── /mcp             → qwui backend (port 8080)   [read-only, bearer auth]
        └── Quickwit (port 7280)

The backend handles auth, CSV export, log pattern detection (Drain algorithm), serves the MCP endpoint, and proxies all Quickwit API calls.

Project structure

qwui/
├── frontend/          # React + Vite app
│   ├── src/
│   └── public/
├── rust-backend/      # Rust backend (VRL, MCP endpoint)
│   └── quickwit-api-surface.json   # vendored Quickwit API contract, see MCP
├── ci/                # Quickwit API spec refresher
├── doc/
│   └── MCP.md         # MCP endpoint reference
├── dev/               # Docker data generator (Python)
├── k6/                # Load tests
├── Dockerfile         # Builds frontend + backend into one image
├── docker-compose.yml
└── Makefile

Development

Prerequisites

  • Docker + Docker Compose
  • Node.js 20+
  • Rust 1.75+

Option 1 — Local backend, Quickwit in Docker

Start Quickwit and the data generator:

make dev

Then run the backend locally:

make run-backend  # cd rust-backend && cargo run

Then start the frontend:

cd frontend && npm install && npm run dev
# or: make run-frontend

Open http://localhost:5173

Option 2 — Backend in Docker

make dev-backend
make run-frontend

Stopping

make down      # stop all containers and wipe data volumes

Logs

make logs                              # all services
docker compose logs -f data-generator # generator only
docker compose logs -f qwui           # backend

Docker Compose services

Service Profile Description
quickwit (always) Quickwit search engine on port 7280
data-generator (always) Continuously ingests sample logs into the demo index
qwui backend Backend on port 8080

Sample data

The data generator runs continuously in two phases:

  1. Backfill — 50 000 events spread over the last 7 days, ingested on startup
  2. Stream — randomised bursts of events with current timestamps, runs forever

Three log types are generated so log pattern detection returns distinct clusters:

  • nginx — HTTP access logs (method, path, status, response time)
  • app — Application logs (logins, orders, cache misses, slow queries)
  • php — PHP errors and warnings with file/line

The index is named demo with timestamp as the timestamp field.

Features

Search toolbar buttons

Button Description
Search Runs the query. If the time range end is "now" (relative range), it is recomputed to the current time before executing.
↑ / ↓ arrows Navigate query history. Previous queries are stored in localStorage (up to 50 entries) and restored with their filters, time range, and VRL script.
Save Saves the current query (search text, filters, time range, columns) into the qwui Quickwit index.
Load Lists queries previously saved in the qwui index.
Share Copies a URL to the clipboard encoding the full query state. Opening the URL restores the exact search.
∿ Patterns Analyses log patterns using the Drain algorithm. Samples events across time buckets, clusters them by similarity, and shows the top patterns with their percentage. A field selector lets you run the analysis on a specific field.
ƒ VRL Opens a VRL (Vector Remap Language) script editor. The script is applied server-side to each result document before it is returned, allowing field extraction, renaming, or computed fields.
Export Exports the current search results as a gzip-compressed CSV file, generated by the backend.

Saved queries — qwui index

Save and Load require a Quickwit index named qwui (configurable via VITE_SAVED_QUERIES_INDEX). Create it once:

curl -X POST http://localhost:7280/api/v1/indexes \
  -H 'Content-Type: application/yaml' \
  --data-binary @- <<'EOF'
version: 0.8
index_id: qwui
doc_mapping:
  timestamp_field: timestamp
  field_mappings:
    - name: timestamp
      type: datetime
      fast: true
      input_formats: [rfc3339]
      output_format: rfc3339
    - name: type
      type: text
      tokenizer: raw
    - name: name
      type: text
    - name: query
      type: json
      stored: true
search_settings:
  default_search_fields: [name, type]
EOF

VRL

The VRL button is shown when the backend reports features.vrl: true in /api/auth/status. The backend embeds the VRL runtime, so this is always true; the flag remains so the frontend degrades cleanly against an older backend.

Example VRL script:

# Parse a JSON string field into structured fields
. = parse_json!(.raw_message)
.level = upcase(.level)

The execution time is shown next to the button after each search.

Multi-index search

Select multiple indexes from the index dropdown. Indexes are searchable together only if they share the same timestamp field — indexes with a different timestamp field are shown as disabled with a tooltip explaining why.

When multiple indexes are selected:

  • Histogram is disabled (field may not exist across all indexes)
  • sort_by is disabled for the same reason
  • Quickwit's native comma-separated index URL format is used internally (/api/v1/index1,index2/search)

Log pattern detection

Click ∿ to cluster the visible logs using the Drain algorithm:

  • The time range is split into 20 equal buckets, 500 events are sampled per bucket in parallel (10 000 events total), avoiding Quickwit's start_offset > 10 000 limit
  • Tokens that look like IDs (IPs, UUIDs, hex strings, numbers, tokens longer than 40 characters) are normalised to <*>
  • Similar log lines are merged into a cluster; the similarity threshold is 0.4
  • Results show the template with <*> wildcards highlighted in orange, and the percentage of logs matching each pattern
  • Each pattern has a Show sample toggle to display an example log line
  • A field selector lets you run the analysis on a specific field instead of the full document

Popular fields

Fields you frequently expand or add as columns are tracked per-index in localStorage under fieldPopularity. The top 10 most-used fields are shown in a Popular section at the top of the fields sidebar, above the full alphabetical list. A popular field is removed from the main list to avoid duplication. The section is hidden when empty.

Popularity is incremented when you click the + column button (not when expanding for top values).

User settings

Accessed via the ⚙ gear icon. Stored in localStorage under userPreferences.

Setting Description
Default tab Whether documents open in Table or JSON view by default
Font size Result table font size in pixels
JSON collapsed Whether JSON view starts collapsed
Display data types Show data type annotations in JSON view
Display object size Show object/array size in JSON view

Dark mode is toggled with the ☀/☾ button and stored separately in localStorage under darkMode.

Visualize mode

Switch between Logs and Visualize using the buttons in the top bar.

In Visualize mode a GraphView panel replaces the results table. You can:

  • Drag a numeric field from the sidebar onto the Y-axis
  • Choose the aggregation (count, sum, avg, min, max)
  • Choose the chart type (bar, line)
  • The X-axis is always time; the histogram interval follows the global interval selector

Only numeric fields are accepted on the Y-axis — float fields are validated via a stats aggregation; text/keyword fields are rejected with an error message.

MCP endpoint — read-only Quickwit access for AI agents

qwui serves a Model Context Protocol endpoint at /mcp, so an agent can search and diagnose the logs the UI shows. Off by default:

MCP_ENABLED=true
MCP_TOKENS=claude-code:$(openssl rand -hex 32)
claude mcp add --transport http qwui https://qwui.example.com/mcp \
  --header "Authorization: Bearer <token>"

17 tools, every one a call to Quickwit's own API — search, aggregations (distinct values, percentiles, counts over time), index and cluster inspection — plus summarize_log_patterns, which reuses the UI's Drain clustering to collapse ten thousand log lines into a handful of templates.

Read-only by construction rather than by flag: a mutating request cannot be expressed in the code, and a test asserts it. Concurrency and rate limits are sized from the capacity Quickwit reports about itself, and every call is audited and counted in Prometheus.

Full documentation: doc/MCP.md — tools, query syntax, authentication, guardrail, audit, and how the tool set is kept in step with Quickwit upgrades.

Environment variables

Variable Default Description
QUICKWIT_URL http://localhost:7280 Quickwit base URL
PORT 8080 Backend listen port
MAX_EXPORT_DOCS 10000 Maximum number of documents per CSV export
VITE_SAVED_QUERIES_INDEX qwui Quickwit index used to store saved queries
OIDC_ENABLED false Enable OIDC authentication
OIDC_CLIENT_ID — OIDC client ID
OIDC_CLIENT_SECRET — OIDC client secret
OIDC_ISSUER — OIDC issuer URL
OIDC_REDIRECT_URL — OIDC redirect URL
OIDC_POST_LOGOUT_REDIRECT_URL — Where the provider returns after logout (see Logout)
OIDC_INTERNAL_URL — Base URL replacing OIDC_ISSUER in qwui's own calls to the provider (see Provider reachable through an internal URL)
OIDC_CA_FILE — PEM bundle trusted, in addition to the system CAs, for qwui's calls to the provider
SESSION_SECRET — Cookie session secret
LOG_LEVEL info Backend log level
ORIGIN — Comma-separated allowed CORS origins
QUICKWIT_INDEXER_URL — Separate endpoint for ingest requests and the MCP indexing_status tool
MCP_ENABLED false Serve the read-only MCP endpoint at /mcp
MCP_TOKENS — Comma-separated bearer tokens. Required when MCP_ENABLED=true, or /mcp is not mounted
MCP_ALLOWED_HOSTS derived Host allowlist. Defaults to localhost plus the hostnames in OIDC_REDIRECT_URL and ORIGIN
MCP_ALLOWED_ORIGINS — Origin allowlist. Empty means unchecked, which is right for agents
MCP_MAX_HITS 50 Ceiling on documents one search_logs call may return
MCP_RATE_LIMIT_PER_MIN 120 Tool calls per token per minute
METRICS_ENABLED false Serve Prometheus metrics at /metrics
MCP_MAX_CONCURRENT_REQUESTS probed Overrides the concurrency derived from Quickwit's own reported capacity

Copy .env.example to .env to get started. .env is gitignored — never commit real secrets.

Startup and readiness

With OIDC enabled, qwui discovers the provider in the background and retries with a backoff (2 s doubling to 60 s) while it is unreachable: the server starts anyway, /ready answers 503 and /login answers 503 with Retry-After until discovery succeeds. A malformed OIDC_ISSUER or OIDC_REDIRECT_URL, or an unreadable OIDC_CA_FILE, still stops qwui at startup. The Helm chart's readiness probe uses /ready.

Provider reachable through an internal URL

The browser and qwui do not always reach the provider the same way: in Kubernetes, the issuer is often a public or VPN-only URL the pod cannot resolve, while the provider answers in-cluster on its Service, with a certificate from a private CA. For example, with Argo CD's Dex:

OIDC_ISSUER=https://argocd.example.com/api/dex
OIDC_INTERNAL_URL=https://argocd-dex-server.argocd.svc.cluster.local:5556/api/dex
OIDC_CA_FILE=/etc/qwui/oidc-ca/ca.crt

OIDC_ISSUER remains the provider's identity: the iss of its tokens, and the base of the URLs the browser is sent to (login, logout), which qwui never fetches itself. For every URL qwui fetches itself (discovery document, token endpoint, keys), an OIDC_ISSUER prefix is replaced with OIDC_INTERNAL_URL. The discovery document still names the public issuer, so the issuer check passes. Only a whole prefix is replaced: the issuer itself, or followed by / or ?. Endpoints the provider publishes under another host are called as published.

Logout

Logging out navigates to /logout, which clears the qwui session cookie and asks the identity provider to end its own SSO session (RP-initiated logout).

Both halves matter. Clearing only the local cookie is not a logout: the provider still holds its SSO session, so the next sign-in is granted silently without a prompt and the user appears never to have logged out.

At startup the backend reads end_session_endpoint from the provider discovery document (<issuer>/.well-known/openid-configuration) and logs whether RP-initiated logout is available. Not every provider implements it — when the endpoint is absent, logout clears the local session only and the backend logs a warning to that effect.

For the return trip to work, OIDC_POST_LOGOUT_REDIRECT_URL must be registered as a valid post-logout redirect URI on the provider side, or the provider will reject the logout request. Leave it empty to omit the parameter and let the provider land on its own default page.

Helm

A Helm chart is available under helm/qwui/.

Install

helm repo add qwui https://gitarns.github.io/qwui
helm repo update
helm install qwui qwui/qwui \
  --set quickwit.url=http://quickwit:7280

Enable ingress

helm install qwui qwui/qwui \
  --set quickwit.url=http://quickwit:7280 \
  --set ingress.enabled=true \
  --set ingress.className=nginx \
  --set "ingress.hosts[0].host=qwui.example.com" \
  --set "ingress.hosts[0].paths[0].path=/" \
  --set "ingress.hosts[0].paths[0].pathType=Prefix"

Key values

Value Default Description
image.repository ghcr.io/gitarns/qwui Image repository
image.tag chart appVersion Image tag
quickwit.url http://quickwit:7280 Quickwit base URL
replicaCount 1 Number of replicas
maxExportDocs — Overrides MAX_EXPORT_DOCS (backend default 10000)
ingress.enabled false Enable ingress
extraEnv / extraEnvFrom [] Extra environment variables, e.g. OIDC settings
oidc.internalUrl — Sets OIDC_INTERNAL_URL
oidc.caSecret.name / .key — / ca.crt Secret holding the provider's CA: mounted and passed as OIDC_CA_FILE
extraVolumes / extraVolumeMounts [] Extra volumes and mounts for the qwui container

OIDC is configured through extraEnv / extraEnvFrom — keep OIDC_CLIENT_SECRET and SESSION_SECRET in a Kubernetes Secret and reference it with extraEnvFrom, rather than passing them via --set.

The MCP endpoint is configured the same way. MCP_TOKENS is a credential, so it belongs in the same Secret — never in --set, where it lands in the release history and your shell history:

extraEnv:
  - name: MCP_ENABLED
    value: "true"
  # In a distributed Quickwit deployment quickwit.url points at a searcher, so
  # the indexing_status tool needs the indexer named separately.
  - name: QUICKWIT_INDEXER_URL
    value: http://quickwit-indexer.quickwit.svc.cluster.local:7280
extraEnvFrom:
  - secretRef:
      name: qwui-secrets   # holds MCP_TOKENS, OIDC_CLIENT_SECRET, SESSION_SECRET

Building for production

docker build -t qwui .

About

Quickwit frontend

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages