Merge Debug Logs for All Nodes

The debug merge-logs command 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 debug zip command to aid in debugging.

Warning:

The file produced by cockroach debug merge-log can contain highly sensitive, unanonymized information, such as usernames, passwords, and possibly your table's data. You should share this data only with Cockroach Labs developers and only after determining the most secure method of delivery.

Subcommands

While the cockroach debug command has a few subcommands, users are expected to only use the encryption-active-key, zip, and debug-merge subcommands.

debug's other subcommands are useful only to CockroachDB's developers and contributors.

Synopsis

  1. $ cockroach debug merge-logs [log file directory] [flags]

Flags

Use the following flags to filter the debug merge-logs results for a specified regular expression or time range.

FlagDescription
—filterLimit the results to the specified regular expression
—fromStart time for the time range filter.
—toEnd time for the time range filter.

Example

Generate a debug zip file:

  1. $ cockroach debug zip ./cockroach-data/logs/debug.zip --insecure

Unzip the file:

  1. $ unzip ./cockroach-data/logs/debug.zip

Merge the logs in the debug folder:

  1. $ cockroach debug merge-logs debug/nodes/*/logs/*

Alternatively, filter the merged logs for a specified time range:

  1. $ cockroach debug merge-logs debug/nodes/*/logs/* --from= "18:36:28.208553" --to= "18:36:29.232864"

You can also filter the merged logs for a regular expression:

  1. ./cockroach debug merge-logs debug/nodes/*/logs/* --filter="RUNNING IN INSECURE MODE"

See also

Was this page helpful?
YesNo