Skip to content

JMESPath

JMESPath was created for AWSCLI (--query) but has standalone commandline versions as well as libraries for various languages.

It is described in an ABNF grammar with a complete specification. This ensures that the language syntax is precisely defined.

https://jmespath.org/

Refs: - Tutorial

Quoting is wierd:

  • Single quotes for literal strings.
  • Backticks to introduce JSON (then double quotes inside).
  • Double quotes are used to select named JSON elements.

github issue#16

Install

sudo wget https://github.com/jmespath/jp/releases/latest/download/jp-linux-amd64 \
  -O /usr/local/bin/jp  && sudo chmod +x /usr/local/bin/jp

Syntax

Negation: "Instances[?!(Tags[?Key=='team'])]"

See also