JL
EN
Docs Home
Menu
Guides

Query Durable Logs

Discover account-scoped SSTable files using /query endpoints.

guide jsonlog

Query Durable Logs

Purpose: discover uploaded SSTable files for an authenticated account.

Preconditions

  • PostgreSQL-backed query routes are enabled in jsonlog deployment.
  • Have a Bearer token with acc claim for account isolation.
  • Provide start_ts and end_ts in every query body.

API/Script Flow

  1. Query files in time range:
    • POST /query with { start_ts, end_ts }.
  2. Refine by channel/level:
    • Add optional channel, level, and limit.
  3. Inspect aggregates:
    • GET /query/stats.

HTTP/curl Flow

JSONLOG_BASE_URL="http://localhost:3002"
ACCESS_TOKEN="<account_scoped_token>"
START_TS="$(($(date +%s) * 1000 - 3600000))"
END_TS="$(($(date +%s) * 1000))"

curl -sS -X POST "${JSONLOG_BASE_URL}/query" \
  -H "authorization: Bearer ${ACCESS_TOKEN}" \
  -H "content-type: application/json" \
  --data "{\"start_ts\":${START_TS},\"end_ts\":${END_TS},\"channel\":\"svc-api\",\"limit\":100}"

curl -sS "${JSONLOG_BASE_URL}/query/stats" \
  -H "authorization: Bearer ${ACCESS_TOKEN}"

Validation

  • Missing token returns 401.
  • start_ts > end_ts returns 400.
  • Success returns 200 with { files, count }.
  • Each file includes path for media-gate fetch and time bounds metadata.