VictoriaLogs with Knot entrypoint, vmauth auth, syslog logging and full Knot startup integration.
2.1K
A VictoriaLogs image for knot spaces. The upstream victoriametrics/victoria-logs image is distroless, so this image lifts the statically-linked victoria-logs-prod binary out and rebases it onto Alpine with the knot entrypoint. vmauth is bundled to provide HTTP basic auth (username/password) in front of VictoriaLogs. A VictoriaLogs instance running inside a space gets the same agent integration, rsyslog logging and startup hooks as every other knot base image.
The image supports running as a log sink on knot Pro: setting KNOT_LOG_SINK_PORT=9428 (off by default) makes the space receive a mirror of the logs of the owner's other spaces in the zone, written straight into VictoriaLogs. The wire format defaults to vl (VictoriaLogs jsonline) via KNOT_LOG_SINK_FORMAT — no need to set it for this image, but it can be changed (loki, gelf, json) if you front the port with something else. Requires the Use Log Sinks permission. See the knot docs on Log Sinks.
VictoriaLogs accepts logs over HTTP (Elasticsearch, Loki, JSON and syslog ingest) and queries them with LogsQL.
All tags are multi-arch (linux/amd64, linux/arm64); see Docker Hub for the current list.
Each release is also tagged <version>-<BUILD_DATE>.
docker run -d \
-p 9428:9428 \
-e VICTORIA_LOGS_USERNAME=alice \
-e VICTORIA_LOGS_PASSWORD=changeme \
-e KNOT_SERVER=https://knot.example.com \
-v vlogs_data:/data \
paularlott/knot-victoria-logs:1.52.0
With VICTORIA_LOGS_USERNAME / VICTORIA_LOGS_PASSWORD set, every request to :9428 (ingest, query and web UI) is gated by HTTP basic auth via vmauth. Leave them unset to run without auth (development mode).
To run the space as a knot Pro log sink (receiving the logs of the owner's other spaces), enable it explicitly — it is off by default. KNOT_LOG_SINK_FORMAT is optional (vl is the default and correct for this image):
docker run -d \
-p 9428:9428 \
-e KNOT_SERVER=https://knot.example.com \
-e KNOT_LOG_SINK_PORT=9428 \
-e KNOT_LOG_SINK_FORMAT=vl \
-v vlogs_data:/data \
paularlott/knot-victoria-logs:1.52.0
Ingest a log entry (JSON line — note _stream must be a JSON object):
curl -X POST http://localhost:9428/insert/jsonline \
-u alice:changeme \
-H 'Content-Type: application/stream+json' \
-d '{"_msg":"hello","_stream":{"app":"demo"},"_time":"2026-01-01T00:00:00Z","level":"info"}'
Query it back via the API or from the host / another space via knot port forwarding:
knot forward port 127.0.0.1:9428 <space> 9428
curl -u alice:changeme 'http://localhost:9428/select/logsql/query?query=*'
The web UI at http://localhost:9428/ will prompt for the same username and password.
Inside the space, VictoriaLogs also listens on 127.0.0.1:8428 without auth (vmauth only fronts the exposed :9428). The knot agent and other in-space processes can ingest or query direct, with no password:
# from within the space — no auth needed
curl -X POST http://127.0.0.1:8428/insert/jsonline \
-H 'Content-Type: application/stream+json' \
-d '{"_msg":"agent log","_stream":{"app":"demo"}}'
From the host you can tunnel straight to that internal port too:
knot forward port 127.0.0.1:8428 <space> 8428
curl 'http://localhost:8428/select/logsql/query?query=*'
On startup the entrypoint:
KNOT_USER to victoria-logs (a service user created at build time).KNOT_SERVER is set, downloads and starts the knot agent (as victoria-logs).rsyslog in forward-only mode and streams logs to the agent's syslog port; otherwise rsyslog is not started./etc/knot-startup.d/ and ~/.knot-startup.d/.VICTORIA_LOGS_USERNAME / VICTORIA_LOGS_PASSWORD are set, generates a vmauth config and starts vmauth on :9428 (basic auth) proxying to VictoriaLogs on 127.0.0.1:8428; otherwise VictoriaLogs listens on :9428 directly.execs victoria-logs as the victoria-logs user, piping its output to syslog so the agent captures it.rsyslog, gosu, sudo and the service user.:9428. When VICTORIA_LOGS_USERNAME / VICTORIA_LOGS_PASSWORD are set, all traffic on :9428 (ingest, query, web UI) requires HTTP basic auth; the entrypoint writes the vmauth config from those env vars on each start. The internal 127.0.0.1:8428 stays open for the agent and in-space services.victoria-logs user (home /home/victoria-logs) is created and the server is run as it via gosu.-storageDataPath /data so log data survives restarts when /data is persisted.VICTORIA_LOGS_RETENTION_PERIOD env var (passed as -retentionPeriod). Override it (e.g. 7d, 365d) without editing the command.rsyslog (tag victoria-logs) because it has no native syslog support and the knot agent collects logs over syslog. vmauth output is captured the same way (tag vmauth).| Variable | Default | Description |
|---|---|---|
KNOT_USER | victoria-logs | Runtime user (forced) |
KNOT_SERVER | (unset) | knot server URL; if set, the agent is started |
KNOT_AGENT_ENDPOINT | (unset) | Agent endpoint reported to the server |
KNOT_SPACEID | (unset) | Space identifier |
KNOT_SYSLOG_PORT | 1514 | Syslog forward target (0 disables forwarding) |
KNOT_LOG_SINK_PORT | (unset — off) | Advertise the space as a log sink (knot Pro): the knot server mirrors the logs of the space owner's other spaces to this port. Off by default — set to 9428 to enable. |
KNOT_LOG_SINK_FORMAT | vl | Format the agent writes mirrored logs in: vl (VictoriaLogs jsonline), loki, gelf or json |
VICTORIA_LOGS_USERNAME | (unset) | Basic-auth username for vmauth; if set with the password, auth is enabled |
VICTORIA_LOGS_PASSWORD | (unset) | Basic-auth password for vmauth |
VICTORIA_LOGS_RETENTION_PERIOD | 30d | How long to keep logs (-retentionPeriod). E.g. 7d, 365d. |
TZ | Etc/UTC | Timezone |
In a knot space these are typically populated from the user's profile:
environment:
- VICTORIA_LOGS_USERNAME=${{.user.username}}
- VICTORIA_LOGS_PASSWORD=${{.user.service_password}}
Plus any VictoriaLogs command-line flags passed via CMD (e.g. -retentionPeriod, -httpListenAddr). See victoria-logs -help.
| Port | Bound to | Auth | Purpose |
|---|---|---|---|
9428 | 0.0.0.0 (exposed) | basic auth (when VICTORIA_LOGS_USERNAME/VICTORIA_LOGS_PASSWORD set) | HTTP API, ingestion, query and web UI — use for remote / port-forwarded access |
8428 | 127.0.0.1 (loopback only) | none | VictoriaLogs direct — for the knot agent and in-space services to ingest/query without a password |
If auth credentials are not set, vmauth is skipped and VictoriaLogs listens on :9428 directly (no auth on either port).
/data — VictoriaLogs storage directory; persist this across restarts to keep log data.VictoriaLogs is Apache License 2.0. This image's packaging — the Dockerfile, knot-entrypoint and supporting scripts/configs — is Apache License 2.0.
Source: paularlott/knot-base-images.
Content type
Image
Digest
sha256:f44630435…
Size
27.6 MB
Last updated
3 days ago
docker pull paularlott/knot-victoria-logs:1.52.0-20261011