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

HashiCorp Certified Terraform Associate – Learning & Exam Tips

I started using Terraform somewhere in 2018, but very limited usage as I thought it is just another tool for provisioning infrastructure and other services – or a variant of Vagrant; ...

In terraform, Sep 18, 2020
Deploy Minikube Using Vagrant and Ansible on VirtualBox – Infrastructure as Code

Minikube is a tool to run a kubernetes cluster locally, that means on your laptop or inside a virtual machine. Minikube will run a single node kubernetes cluster on your machine with ...

In kubernetes, Aug 11, 2020
How to Pass CKA & CKAD Exams ? 10 Tips for Kubernetes Exams

Here see the best tips for Kubernetes Exams - Certified Kubernetes Administrator (CKA) & Certified Kubernetes Application Developer (CKAD).

In kubernetes, Jul 08, 2020
CKA & CKAD - Kubernetes Exam Tips, Learning Path and Certification

Since kubernetes is getting wide acceptance, Kubernetes Certification is the most trending one in IT circle now. I have completed both recently (March – April 2020) and I started gett...

In kubernetes, May 03, 2020

Featured