
logql-to-logsql
Web application that provides a simple proof-of-concept UI for querying VictoriaLogs or VictoriaTraces data with Loki LogQL.
It can translate Loki LogQL queries to VictoriaLogs LogsQL,
optionally executing the translated query against a VictoriaLogs or VictoriaTraces endpoint.

Highlights
- 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.
Quick start
Try without installation
You can try the live demo on logql-to-logsql.fly.dev
Use binaries
Just download the latest release from Releases page and run it.
Run Docker image
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:latest
Here 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
Run locally with Go
- Install Go 1.25+, Node.js 24+, and npm.
- Run the command (defaults to
:8080):
make run
make run compiles the frontend (npm install && npm run build) and then executes go 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-logsql
Use Docker (build from sources)
Build 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-logsql
Configuration
The binary accepts an optional JSON configuration file with the -config flag:
logql-to-logsql -config ./config.json
Example (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.
Translation coverage
- Log queries: stream selectors, line filters (
|=, !=, |~, !~), label filters, json/logfmt/regexp/pattern parsers (translated to LogsQL pipes), drop/keep, line_format/label_format (best-effort template conversion).
- Metric queries (subset):
rate, count_over_time, sum(...), topk/bottomk, plus a few *_over_time functions with unwrap.
REST API
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.
POST /api/v1/logql-to-logsql
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": "..." }.
GET /api/v1/config
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
}
GET /healthz
Simple health endpoint returning { "status": "ok" }.
Static UI
GET / and any unrecognised path serves the embedded web bundle (cmd/logql-to-logsql/web/dist). Assets are cached in memory on first access.
Web UI
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.
Contributing
Contributions are welcome. Please:
- Read and follow the Code of Conduct.
- Run
make all before submitting a PR.
- Ensure new features include translation tests under
lib/logsql and, when relevant, API tests under cmd/logql-to-logsql/api.
License
Licensed under the GNU Affero General Public License, Version 3.