Skip to main content
The cockroach debug merge-logs merges log files from multiple nodes into a single time-ordered stream of messages with an added per-message prefix to indicate the corresponding node. You can use it in conjunction with logs collected using the command to aid in debugging.
The file produced by cockroach debug zip can contain highly , such as usernames, hashed passwords, and possibly your table’s data. You can use the --redact flag to redact the sensitive data out of log files and crash reports before sharing them with Cockroach Labs.

Subcommands

While the cockroach debug command has a few subcommands, users are expected to use only the , , , , , and subcommands. We recommend using the and subcommands only when directed by the . The other debug subcommands are useful only to Cockroach Labs. Output of debug commands may contain sensitive or secret information.

Synopsis

Flags

The debug merge-logs subcommand supports the following flags:
FlagDescription
--formatRequired The in the log file directory. The logs in a .zip generated using are of type .
--filterLimit the results to the specified regular expression
--fromStart time for the time range filter.
--toEnd time for the time range filter.
--redactRedact from the log files.

Example

Generate a debug zip file:
Unzip the file:
Merge the logs in the debug folder:
Alternatively, filter the merged logs for a specified time range:
You can also filter the merged logs for a regular expression:
You can redact sensitive information from the merged logs:

Considerations

As of v23.2, logs can be configured to use a . This is a . cockroach debug merge-logs requires v23.2 or later if run against logs with the timezone configured. With versions prior to v23.2, cockroach debug merge-logs will return an error if run against logs with the timezone configured.

See also