Hi,
The Grafana Log Search dashboard queries VictoriaLogs, and you can hit the same query API directly with a read-only token, which fits your case better than the dashboard:
GET https://api.fly.io/victorialogs/<org-slug>/select/logsql/query
Authorization: <read-only token for the org> (e.g. fly tokens create readonly <org-slug>)
The fly.app.instance field is the full Fly Machine ID, and fly.app.name is the app name. Whether you use the dashboard variables or write the query yourself, these filters are part of the LogsQL query and VictoriaLogs applies them on the server.
You can get severity counts with a stats pipe. Only the aggregate rows come back:
fly.app.name:"my-app" fly.app.instance:"<machine-id>" | stats by (log.level) count() as n
(log.level is populated from your app’s output, so lines with no level show up with an empty value. Count those as “unknown”.)
To limit the number of records, pass the limit=N query parameter, or end the query with | limit N. With limit, VictoriaLogs returns the N most recent matching entries.
For timestamp boundaries, pass start and end as RFC3339 UTC timestamps (e.g. start=2026-11-30T10:00:00Z&end=2026-11-30T11:00:00Z). You can also put the window in the query itself: _time:[2026-11-30T10:00:00Z, 2026-11-30T11:00:00Z). Retention is around 7 days but this is not guaranteed as it can depend on some operational parameters on our side. In general it’s best to treat logs as streaming; if you need longer-term storage (longer = more than 2 days) you’re better off setting a log shipper.
For errors:
- An invalid query or server error returns a non-200 status with a plain-text error body.
- The response is newline-delimited JSON (one object per line). If a failure happens partway through a query, VictoriaLogs can write a plain-text error line into an otherwise 200 response. Treat any line that isn’t valid JSON as a failed/partial result.
- There’s no explicit “truncated” flag. If you get exactly limit rows, assume there may be more. To measure coverage, run a | stats count() over the same filter and time window and compare it with the number of rows you received.
Example:
curl -G https://api.fly.io/victorialogs/<org-slug>/select/logsql/query \
-H "Authorization: $FLY_READ_TOKEN" \
--data-urlencode 'query=fly.app.name:"my-app" | stats by (log.level) count() as n' \
--data-urlencode 'start=2026-11-30T10:00:00Z' \
--data-urlencode 'end=2026-11-30T11:00:00Z'
This needs no Log Shipper and doesn’t use the /api/v1/apps/:app/logs endpoint.