rpk transform logs
View logs for a transform.
Data transform’s STDOUT and STDERR are captured during runtime and written to an internally managed topic _redpanda.transform_logs
.
This command outputs logs for a single transform over a period of time and printing them to STDOUT. The logs can be printed in various formats.
By default, only logs that have been emitted are displayed. Use the --follow
flag to stream new logs continuously.
Filtering
The --head
and --tail
flags are mutually exclusive and limit the number of log entries from the beginning or end of the range, respectively.
The --since
and --until
flags define a time range. Use one or both flags to limit the log output to a desired period of time.
Both flags accept values in the following formats:
Value | Description |
---|---|
|
the current time, useful for --since=now |
|
parsed as a Unix millisecond |
|
parsed as a Unix second |
|
parsed as a day, UTC |
|
parsed as RFC3339, UTC; fractional seconds optional (.MMM) |
|
a negative duration from now |
|
a positive duration from now |
Durations are parsed simply:
Value | Description |
---|---|
|
three milliseconds |
|
ten seconds |
|
nine minutes |
|
one hour |
|
one minute and three milliseconds |
Formatting
Logs can be displayed in a variety of formats using --format
.
The default --format=text
prints the log record’s body line by line.
When --format=wide
is specified, the output includes a prefix that is the date of the log line and a level for the record. The INFO level corresponds to being emitted on the transform’s STDOUT, while the WARN level is used for STDERR.
The --format=json
flag emits logs in the JSON encoded version of the Open Telemetry LogRecord protocol buffer.
Examples
Reads logs within the last hour:
rpk transform logs --since=-1h
Reads logs prior to 30 minutes ago:
rpk transform logs --until=-30m
The following command reads logs between noon and 1pm on March 12th:
rpk transform logs my-transform --since=2024-03-12T12:00:00Z --until=2024-03-12T13:00:00Z
Flags
Value | Type | Description |
---|---|---|
|
- |
Specify if the logs should be streamed. |
|
string |
Output format (json,yaml,text,wide,help) (default "text"). |
|
int |
The number of log entries to fetch from the start. |
|
- |
Help for logs. |
|
timestamp |
Start reading logs after this time (now, -10m, 2024-02-10). See Filtering for format details. |
|
int |
The number of log entries to fetch from the end. |
|
timestamp |
Read logs up unto this time (-1h, 2024-02-10T13:00:00Z). See Filtering for format details. |
|
string |
Redpanda or |
|
stringArray |
Override rpk configuration settings; '-X help' for detail or '-X list' for terser detail. |
|
string |
rpk profile to use. |
|
- |
Enable verbose logging. |