rpk topic trim-prefix
|
When you delete records from a topic with a timestamp, Redpanda advances the partition start offset to the first record whose timestamp is after the threshold. If record timestamps are not in order with respect to offsets, this may result in unintended deletion of data. Before using a timestamp, verify that timestamps increase in the same order as offsets in the topic to avoid accidental data loss. For example:
|
Trim records from topics by setting the LogStartOffset for partitions to the requested offset. All segments whose base offset is less than the requested offset are deleted, and any records within the segment before the requested offset can no longer be read.
Flags
| Value | Type | Description |
|---|---|---|
|
string |
Path to a file specifying topic, partition, and offset values to trim. |
|
bool |
Disable confirmation prompt. |
|
string |
Offset to set the partition’s start offset to ( |
|
int32Slice |
Comma-separated list of partitions to trim records from (default to all). |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |