Skip to content

Latest commit

 

History

History
83 lines (59 loc) · 2.64 KB

cockroach-debug-merge-logs.md

File metadata and controls

83 lines (59 loc) · 2.64 KB
title summary toc key
cockroach debug merge-logs
Learn the command for merging the collected debug logs from all nodes in your cluster.
true
debug-merge-logs.html

The cockroach 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.

{{site.data.alerts.callout_danger}} The file produced by cockroach debug zip can contain highly sensitive, identifiable information, 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. {{site.data.alerts.end}}

Subcommands

{% include {{ page.version.version }}/misc/debug-subcommands.md %}

Synopsis

$ 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.

Flag Description
--filter Limit the results to the specified regular expression
--from Start time for the time range filter.
--to End time for the time range filter.
--redact Redact sensitive data from the log files.

Example

Generate a debug zip file:

{% include_cached copy-clipboard.html %}

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

Unzip the file:

{% include_cached copy-clipboard.html %}

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

Merge the logs in the debug folder:

{% include_cached copy-clipboard.html %}

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

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

{% include_cached copy-clipboard.html %}

$ 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:

{% include_cached copy-clipboard.html %}

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

You can redact sensitive information from the merged logs:

{% include_cached copy-clipboard.html %}

cockroach debug merge-logs --redact debug/nodes/*/logs/*

See also