Skip to content

Clusters

Failure clusters in Qualflare group similar test failures together, helping you identify patterns and common root causes. The clusters commands let you list and inspect cluster records across your project.

qf clusters list

List all failure clusters in the project, with optional filters for severity.

Syntax

bash
qf clusters list [flags]

Flags

FlagTypeDefaultDescription
--severitystring sliceFilter by severity. Accepts comma-separated values: critical, high, medium, low
--pageint0Page number for paginated results
--sort-bystringField name to sort results by
--sort-descboolfalseSort results in descending order
--api-keystringAPI key for authentication. Overrides QF_API_KEY environment variable

Examples

bash
# List all failure clusters
qf clusters list

# Filter by a single severity
qf clusters list --severity critical

# Filter by multiple severities
qf clusters list --severity critical,high

# Sort by failure count, highest first
qf clusters list --sort-by failureCount --sort-desc

# Paginate through results
qf clusters list --page 2

Example Output

json
{
  "clusters": [
    {
      "id": 15,
      "severity": "critical",
      "failureCount": 38,
      "pattern": "NullPointerException in PaymentService.processRefund",
      "firstSeenAt": "2026-03-15T09:10:00Z",
      "lastSeenAt": "2026-03-28T17:45:00Z"
    }
  ],
  "total": 1
}

qf cluster get <id>

Fetch full details for a single failure cluster by its ID.

Note: Unlike most other resources (which use <seq>), cluster lookup uses an <id>. Make sure to pass the cluster's ID, not its sequence number.

Syntax

bash
qf cluster get <id>

Arguments

ArgumentDescription
idThe ID of the failure cluster to retrieve

Flags

FlagTypeDefaultDescription
--api-keystringAPI key for authentication. Overrides QF_API_KEY environment variable

Examples

bash
# Get failure cluster with ID 15
qf cluster get 15

# Get cluster and pipe to jq
qf cluster get 15 | jq '.pattern'

Example Output

json
{
  "id": 15,
  "severity": "critical",
  "failureCount": 38,
  "pattern": "NullPointerException in PaymentService.processRefund",
  "firstSeenAt": "2026-03-15T09:10:00Z",
  "lastSeenAt": "2026-03-28T17:45:00Z"
}

Working with JSON Output

All cluster commands output pretty-printed JSON to stdout, making them easy to pipe to jq for filtering and transformation.

bash
# List all cluster patterns
qf clusters list | jq '.clusters[].pattern'

# Find the cluster with the highest failure count
qf clusters list | jq '.clusters | max_by(.failureCount) | {id, pattern, failureCount}'

# Count clusters by severity
qf clusters list | jq '[.clusters[].severity] | group_by(.) | map({severity: .[0], count: length})'

# Get all critical cluster IDs
qf clusters list --severity critical | jq '[.clusters[].id]'

# Check the failure count for a specific cluster
qf cluster get 15 | jq '.failureCount'

See Also

  • Defects — List and inspect defect records linked to failed test cases
  • Other Commands — Utility commands including validate and list-formats
  • Configuration — Environment variables and global flags reference