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
accclaim for account isolation. - Provide
start_tsandend_tsin every query body.
API/Script Flow
- Query files in time range:
POST /querywith{ start_ts, end_ts }.
- Refine by channel/level:
- Add optional
channel,level, andlimit.
- Add optional
- 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_tsreturns400.- Success returns
200with{ files, count }. - Each file includes
pathfor media-gate fetch and time bounds metadata.