Cloud

rpk transform logs

View logs for a data transform. Streams STDOUT and STDERR output captured during runtime to your terminal.

Usage

rpk transform logs NAME [flags]

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 of both flags to limit the log output to a desired period of time.

Both flags accept values in the following formats:

Value Description

now

the current time, useful for --since=now

13 digits

parsed as a Unix millisecond

9 digits

parsed as a Unix second

YYYY-MM-DD

parsed as a day, UTC

YYYY-MM-DDTHH:MM:SSZ

parsed as RFC3339, UTC; fractional seconds optional (.MMM)

-dur

a negative duration from now

dur

a positive duration from now

Durations are parsed simply:

Value Description

3ms

three milliseconds

10s

ten seconds

9m

nine minutes

1h

one hour

1m3ms

one minute and three milliseconds

For example,

--since=-1h   reads logs within the last hour \
--until=-30m  reads logs prior to 30 minutes ago

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

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.

Aliases

rpk transform log

Flags

Value Type Description

-f, --follow

bool

Specify if the logs should be streamed.

--format

string

Output format (json,yaml,text,wide,help).

--head

int

The number of log entries to fetch from the start.

--since

timequery

Start reading logs after this time (now, -10m, 2024-02-10).

--tail

int

The number of log entries to fetch from the end.

--until

timequery

Read logs up unto this time (-1h, 2024-02-10T13:00:00Z).

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.