Kubernetes

Kubernetes JSONPath Tester

Test a kubectl JSONPath expression against a JSON document and see how it is evaluated.

Expression

The surrounding {...} braces that kubectl uses are optional here.

Document

Evaluated in your browser. The expression is parsed and walked, never executed — there is no eval here.

Matches
2

As kubectl -o jsonpath prints it

api-7d9f worker-2a1b

Individual values

  1. 0api-7d9f
  2. 1worker-2a1b
How it was read
  1. 1.start at the document root
  2. 2.read the field "items"
  3. 3.take every element or value
  4. 4.read the field "metadata"
  5. 5.read the field "name"
Differences from kubectl
  • kubectl does not accept bracket-quoted keys containing dots. For a label like app.kubernetes.io/name it needs escaped dots: {.metadata.labels.app\.kubernetes\.io/name}. This tester accepts the bracket form too.
  • kubectl's {range}…{end} template blocks are not supported here; use a plain path and read the individual values instead.
  • Filters compare numerically when both sides are numbers, and as strings otherwise — the same rule kubectl applies.