Retrieve the 50 most recent events:
Retrieve the last 24 hours as JSONL:
kongctl get audit-logs --since 24h --output jsonl > audit-logs.jsonl
Use inclusive RFC3339 bounds and an event type filter:
kongctl get audit-logs \
--start-time 2026-08-23T00:00:00Z \
--end-time 2026-08-24T00:00:00Z \
--type authorization
Supported event types are authentication, authorization, and
gateway_access. Complete API records include their ED25519 signatures.
kongctl doesn’t verify signatures or retrieve JWKS.
--page-size controls the maximum number of records requested in each API
call. It defaults to 100 and accepts values from 1 through 1,000. kongctl
continues through the returned cursor until it reaches the final page.
--limit controls the total records returned by the client. It defaults to 50
when you don’t specify a time window. Time-window queries are unlimited unless
you specify --limit. Set --limit 0 explicitly for unlimited retrieval.
JSON and YAML output include metadata.count and metadata.truncated.
truncated is true when a limit stops collection while more records exist.
--start-time and --end-time accept inclusive RFC3339 timestamps. --since
accepts a Go duration, such as 30m or 24h, and can’t be combined with an
absolute bound. kongctl resolves --since once at startup for finite pulls.
Go durations don’t support d or w. Use 24h for one day and 168h for
one week.
Finite pulls support text, json, yaml, and jsonl:
- JSON and YAML are buffered and written after every required page succeeds.
- JSONL writes completed pages immediately. If a later page fails, STDOUT
contains a partial collection and kongctl exits with a nonzero status.
- Text output provides a compact summary. Use repeated
--columns HEADER=.field flags to select fields.
- JSON and YAML apply
--jq to the output envelope. JSONL applies it to each
record independently.
Automation must check the exit status instead of relying on the output file’s
presence:
if kongctl get audit-logs --since 24h --output jsonl > audit-logs.jsonl; then
echo "Audit-log collection completed"
else
echo "Audit-log collection failed or is partial" >&2
exit 1
fi