# Machine-specific log retrieval using Fly-hosted Grafana

**URL:** <https://community.fly.io/t/machine-specific-log-retrieval-using-fly-hosted-grafana/29215>\
**Category:** Questions / Help\
**Tags:** logs, grafana\
**Created:** [November 30, 2026, 9:35pm UTC](https://community.fly.io/t/machine-specific-log-retrieval-using-fly-hosted-grafana/29215 "2026-11-30T21:35:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mansaandclee](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/mansaandclee/32/51833_2.png) [@mansaandclee](https://community.fly.io/u/mansaandclee)\
**Post date:** [November 30, 2026, 9:35pm UTC](https://community.fly.io/t/machine-specific-log-retrieval-using-fly-hosted-grafana/29215/1 "2026-11-30T21:35:06Z")

</div>

Hi,

We’re looking for a supported, read-only method to collect application-runtime logs during staging acceptance tests, without deploying additional logging infrastructure.

We’re currently using Fly-hosted Grafana Log Search backed by VictoriaLogs.

The dashboard exposes App, Instance and Query variables, but we need clarification on the following:

1. Does the Instance selector correspond to the exact Fly Machine ID, and are App/Instance filters applied server-side?

2. Can we use LogsQL aggregation to obtain severity counts without returning raw log messages?

3. How can we bound the number of records returned or use a supported bounded record view?

4. How should we specify exact absolute UTC time boundaries?

5. How can we identify query errors, partial results or truncation?

We don’t require guarantees of complete log ingestion. We intend to explicitly report incomplete or unknown coverage where appropriate.

If the hosted Grafana dashboard cannot support this, is there another officially supported method that doesn’t require a new Log Shipper or reliance on the unsupported external HTTP Logs endpoint?

Any documentation or working example would be greatly appreciated.

Thank you!

---

<div class="post-metadata">

**Author:** ![flyio-support](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/flyio-support/32/46245_2.png) [@flyio-support](https://community.fly.io/u/flyio-support)\
**Post date:** [December 1, 2026, 10:11pm UTC](https://community.fly.io/t/machine-specific-log-retrieval-using-fly-hosted-grafana/29215/4 "2026-12-01T22:11:36Z")

</div>

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](https://api.fly.io/victorialogs/%3Corg-slug%3E/select/logsql/query)

Authorization: \<read-only token for the org\> (e.g. `fly tokens create readonly <org-slug>`)

The [fly.app](https://fly.app).instance field is the full Fly Machine ID, and [fly.app.name](https://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`](https://fly.app.name)`:"my-app" `[`fly.app`](https://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:

```auto
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.
