Skip to main content

YAML/JSON Path Tester - JSONPath & YAML Path Expression Tester

Free online YAML and JSON Path tester. Test JSONPath and YAML path expressions in real-time with instant results. Perfect for Kubernetes configs, CI/CD pipelines, and API testing. 100% client-side processing.

0 matches found

Quick Examples (Click to Load)

JSON $.store.book[*].author Get all book authors
JSON $.store.book[?(@.price < 10)] Books under $10
YAML spec.containers[*].image Kubernetes container images
YAML metadata.labels.app Kubernetes app label

JSONPath Syntax Reference

$ Root element
@ Current element (in filters)
. or [] Child operator
* Wildcard (all elements)
[start:end] Array slice
[?(<expr>)] Filter expression

What is JSONPath?
#

JSONPath is a query language for JSON, similar to XPath for XML. It provides a way to extract specific data from a JSON document using path expressions. JSONPath is widely used in DevOps tools, CI/CD pipelines, and API testing.

Common JSONPath Operators
#

OperatorDescriptionExample
$Root element$
@Current element (in filters)@.price
.Child operator$.store.book
[]Subscript operator$.store.book[0]
*Wildcard (all elements)$.store.book[*]
[start:end]Array slice$.store.book[0:2]
[?()]Filter expression$.store.book[?(@.price < 10)]

Common Use Cases
#

Kubernetes Configuration
#

JSONPath is built into kubectl for extracting data from resources:

1
2
3
4
5
6
7
8
# Get all pod names
kubectl get pods -o jsonpath='{.items[*].metadata.name}'

# Get container images from a deployment
kubectl get deployment nginx -o jsonpath='{.spec.template.spec.containers[*].image}'

# Get all node IP addresses
kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}'

CI/CD Pipelines
#

Extract values from configuration files:

1
2
3
4
5
# GitHub Actions example
- name: Get version
  run: |
    VERSION=$(cat package.json | jq -r '.version')
    echo "VERSION=$VERSION" >> $GITHUB_ENV

API Response Parsing
#

Query API responses in tests or scripts:

1
2
3
// Using JSONPath to extract data
const authors = jsonpath.query(response, '$.store.book[*].author');
const cheapBooks = jsonpath.query(response, '$.store.book[?(@.price < 10)]');

YAML Path Expressions
#

YAML path expressions work similarly to JSONPath but are designed for YAML documents. Since YAML is a superset of JSON, you can use the same path syntax:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Kubernetes Pod manifest
apiVersion: v1
kind: Pod
metadata:
  name: my-pod
  labels:
    app: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2

Path expressions for this YAML:

  • metadata.namemy-pod
  • metadata.labels.appnginx
  • spec.containers[*].image["nginx:1.14.2"]

Filter Expressions
#

Filter expressions allow you to select elements based on conditions:

ExpressionDescription
[?(@.price < 10)]Elements where price is less than 10
[?(@.price > 20)]Elements where price is greater than 20
[?(@.category == 'fiction')]Elements where category equals ‘fiction’
[?(@.price != 8.95)]Elements where price is not 8.95

Privacy & Security
#

All processing happens directly in your browser:

  • No Server Communication: Your JSON/YAML data never leaves your device
  • No Storage: Nothing is saved to localStorage, cookies, or servers
  • Open Source: All code is transparent and auditable
Pro Tip
Bookmark this page for quick access when debugging Kubernetes configs or API responses. The examples load instantly to help you test common patterns.

Related Tools#

Explore our other DevOps tools: