diag
Manages diagnostic bundles. For failover mode, see how to prevent and troubleshoot CLI problems.
Sub-commands:
Sub-commands and Options
diag create
Create a diagnostic bundle for this instance.
Usage:
./cribl diag createArguments:
| Option | Definition |
|---|---|
-d | Run create in debug mode. |
-j | Do not append ‘.txt’ to js files. |
-k | Include metrics for the top 10 Sources, Destinations, Pipelines, Routes, and Packs from the last 24 hours. This matches the Include top talkers option in the UI and is separate from the main metrics store controlled by -M. |
-t <maxIncludeJobs> | Maximum number of jobs (and all associated tasks) to include in the bundle. |
-M | Exclude the persistent internal metrics store from the bundle. This reduces bundle size, especially on Leaders and single-instance deployments, but does not remove other metric-related data (such as logs or data added with -k). |
-g | Exclude git from bundle. |
-i | Include install logs. |
Windows PowerShell usage:
PS > $env:CRIBL_VOLUME_DIR='c:\ProgramData\Cribl'; & 'c:\Program Files\Cribl\bin\cribl.exe' diag create
The Windows command requires the
CRIBL_VOLUME_DIRenvironment variable. If your deployment doesn’t use the default path (c:\ProgramData\Cribl), verify thatCRIBL_VOLUME_DIRpoints to the correct directory. Otherwise, you might get empty diag files.
Sample response:
Created diagnostic bundle at c:\ProgramData\Cribl\diag\edge-DESKTOP-C9BEMQ2-20240925T222216.tar.gzWindows CMD usage:
> set "CRIBL_VOLUME_DIR=c:\ProgramData\Cribl" && "c:\Program Files\Cribl\bin\cribl.exe" diag create
Sample response:
Created diagnostic bundle at c:\ProgramData\Cribl\diag\edge-DESKTOP-C9BEMQ2-20240925T222216.tar.gzDiagnostic Bundles and Failover
If Cribl is configured for failover, the Leader stores its runtime state (including jobs, job history, and similar data) in a special failover volume instead of the default install /state directory. The running Leader process sets the CRIBL_STATE_DIR environment variable to the failover volume, such as <failover-volume>/state. However, the CLI is a separate process and does not inherit the CRIBL_STATE_DIR environment variable from the Leader.
To collect a complete diagnostic bundle, set CRIBL_STATE_DIR when you run the diag create subcommand as shown in the following example. Replace <failover-volume> with the root path of the failover volume in your environment (such as /mnt/cribl-failover) so that CRIBL_STATE_DIR resolves to the same path that the Leader uses.
CRIBL_STATE_DIR=<failover-volume>/state ./cribl diag create -gAlign the environment variables CRIBL_CONF_DIR and CRIBL_VOLUME_DIR with your deployment as for other CLI commands.
If you do not set the CRIBL_STATE_DIR environment variable in the shell, the CLI may default to <configuration-root>/state and the bundle may omit the failover state (for example, it may have empty or incomplete job data).
diag cpuprofile
Collect a 30-second CPU profile and place in the diag directory.
Usage:
./cribl diag cpuprofile -p 12345Sample response:
Created a Cribl diagnostic bundle at /opt/cribl/diag/<product>-zedborcdb72f-20210820T204405.tar.gzArguments:
| Option | Definition |
|---|---|
-p <pid> | The pid of the process to dump the CPU profile. |
diag heapsnapshot
Generate heap snapshot of a Cribl process and place in the diag directory.
Usage:
./cribl diag heapsnapshot -p 12345Sample response:
Heap-1672574400000-12345.heapsnapshotThe response format is
Heap-<epoch-timestamp>-<pid>.heapsnapshot.
Arguments:
| Option | Definition |
|---|---|
-p <pid> | The pid of the process to dump the heap snapshot. |
diag list
List existing diagnostic bundles.
diag perf
Collect a 30-second CPU profile and a heapsnapshot and place both in the diag directory.
| Option | Definition |
|---|---|
-p <pid> | The pid of the process to dump both the CPU profile and heap snapshot. |
diag send
Send diagnostics bundle to Cribl Support.
./cribl diag send -c 00001234Arguments:
| Option | Definition |
|---|---|
-c <caseNumber> | Cribl Support Case Number. |
-p <path> | Diagnostic bundle path. If empty, it creates a new bundle. |