json, yaml,

JSON PATH Query

Follow · 1 min read
Share this

Ref: https://github.com/json-path/JsonPath

Basic Dictionary

$.car.wheels[2]                   # 2rd item
$.[0,3]                           # 1st and 4th elements from array
$.[0:4]                           # 1st to 4th elements from array
                                    excluding 4th element
$.[0:6:2]                         # 1st to 4th  elements with steps 2 (skip one element each time)                        
$.[-1:0]                          # last item
$.[-8:-2]                         # from bottom
$.[0:5].phone                     # first five   
$.[-5:].age                       # last 5 entries    

Wild Card

$.[*]                             
$.[*].color                       # color property of any parent items
$.car.wheels[*].model
$.[*].wheels[*].model
$.employee.payslips[*].amount
$.prizes[*].laureates[*].firstname
$.prizes[?(@.year == 2014)].laureates[*].firstname 
                                  # all firstname but for year 2014
                          

JSON PATH in kubernetes

Latest Stories

How To Get Hands-On Experience in AWS

Every Time you have the same situation, you know the technology and maybe you are already a certified professional in that technology, but you are not getting enough hands-on on that ...

In AWS, Jan 04, 2021
Getting Started with Ansible Collections

Ansible Collection is a great way of getting content contributions from various Ansible Developers. Earlier there was a tagline for Ansible – “Batteries included”, but now the battery...

In redhat, ansible, Dec 22, 2020
Configure Your Windows Host to be Managed by Ansible

I was talking to my friend about Ansible automation and how we are implementing automated solutions for cloud and on-premise infrastructure. Then he told me that, his team is looking ...

In redhat, ansible, Dec 01, 2020
Remove nodes from Kubespray Managed Kubernetes Cluster

Kubespray is a combination of Ansible and Kubernetes and you can use Kubespray for deploying production ready Kubernetes clusters. You can manage full-lifecycle of Kubernetes clusters...

In containers, kubernetes, Nov 30, 2020
Adding new nodes to Kubespray Managed Kubernetes Cluster

Kubespray is a combination of Ansible and Kubernetes and you can use Kubespray for deploying production ready Kubernetes clusters. Learn how to add new nodes in a Kubernetes cluster u...

In containers, kubernetes, Nov 27, 2020

Featured