Web application that provides a simple proof-of-concept UI for querying VictoriaLogs or VictoriaTraces data with Loki LogQL.
It translates Loki LogQL queries to VictoriaLogs LogsQL, optionally executes the translated query against a VictoriaLogs or VictoriaTraces endpoints.
- Go app + library
- AGPL license because the official LogQL parser is used as a dependency, which is licensed under AGPL
- Simple Web UI featuring LogQL editing, example gallery, and query results rendering.
- Simple REST API (
/api/v1/logql-to-logsql) that you can call from scripts, CI, or other services.
You can try the live demo on play-logql.victoriametrics.com
Just download the latest release from Releases page and run it.
You can run logql-to-logsql using Docker. This is the easiest way to get started without needing to install Go or build from source:
docker run -d --name logql-to-logsql -p 8080:8080 -v /data/views \
ghcr.io/victoriaMetrics-community/logql-to-logsql:latestHere is the example with specified config file:
cat > config.json << EOL
{
"listenAddr": ":8080",
"endpoint": "https://play-vmlogs.victoriametrics.com",
"bearerToken": ""
}
EOL
docker run -d --name logql-to-logsql -p 8080:8080 \
-v /home/logql-to-logsql/data/views \
-v ./config.json:/home/logql-to-logsql/config.json:ro \
ghcr.io/victoriaMetrics-community/logql-to-logsql:latest \
--config=config.json- Install Go 1.25+, Node.js 24+, and npm.
- Run the command (defaults to
:8080):make run
make runcompiles the frontend (npm install && npm run build) and then executesgo run ./cmd/logql-to-logsql. - Verify the service:
curl http://localhost:8080/healthz # {"status":"ok"} - Open http://localhost:8080 to use the web UI.
You can skip the UI rebuild if the embedded bundle already exists:
go run ./cmd/logql-to-logsqlBuild and run the containerised service (no Node.js required on the host):
docker build -t logql-to-logsql .
docker run -d -p 8080:8080 -v /data/views logql-to-logsqlThe binary accepts an optional JSON configuration file with the -config flag:
logql-to-logsql -config ./config.jsonExample (config.json):
{
"listenAddr": ":8080",
"endpoint": "https://play-vmlogs.victoriametrics.com",
"bearerToken": "<VM_BEARER_TOKEN>",
"limit": 1000
}| Field | Type | Description | Default |
|---|---|---|---|
listenAddr |
string | Address the HTTP server binds to. | :8080 |
endpoint |
string | VictoriaLogs base URL. Can be left empty (in this case you can specify it in UI or translate without executing queries) | empty |
bearerToken |
string | Optional bearer token injected into VictoriaLogs requests when endpoint is set. |
empty |
limit |
int | Maximum number of rows returned by any query. | 1000 |
Please note that VictoriaLogs is called via the backend, so if you are using logql-to-logsql in Docker, localhost refers to the localhost of the container, not your computer.
All JSON responses include either a translated logsql statement, optional data payload (raw VictoriaLogs response or newline-delimited JSON), or an error message.
Security headers (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection) are set on every response.
Translate (and optionally execute) a SQL statement.
Request body:
{
"logql": "<query>",
"endpoint": "https://victoria-logs.example.com",
"execMode": "translate|query",
"bearerToken": "...",
"start": "...",
"end": "..."
}Successful response:
{
"logsql": "<translated>",
"data": "<optional raw response>",
"error": "<optional>"
}Errors emit HTTP 4xx/5xx with { "error": "..." }.
Returns the endpoint and max rows limit configured on the server (used by the UI to decide whether the endpoint fields should be read-only):
{
"endpoint": "https://victoria-logs.example.com",
"limit": 1000
}Simple health endpoint returning { "status": "ok" }.
GET / and any unrecognised path serves the embedded web bundle (cmd/logql-to-logsql/web/dist). Assets are cached in memory on first access.
Key features:
- LogQL editor with syntax highlighting, keyword completions, example gallery (
examples.ts), and keyboard shortcuts (Shift/Ctrl/Cmd + Enter). - Endpoint panel to toggle VictoriaLogs execution, edit URL/token, or switch to translation-only mode. If the server was booted with a fixed endpoint, fields are prefilled and locked.
- Result viewer rendering newline-delimited JSON into a table when VictoriaLogs is queried, or showing the translated LogsQL when running offline.
- Docs sidebar explaining supported SQL syntax.
Contributions are welcome. Please:
- Read and follow the Code of Conduct.
- Run
make allbefore submitting a PR. - Ensure new features include translation tests under
lib/logsqland, when relevant, API tests undercmd/logql-to-logsql/api.
Licensed under the GNU Affero General Public License, Version 3.
