JSONPath Online logojsonpath.online

JMESPath vs jq

jq is a powerhouse CLI; JMESPath is the lightweight query language built into AWS CLI and SDKs. Here’s how to pick the right tool for each job.

Feature comparison

AspectJMESPathjq
Form factorEmbedded query languageStandalone CLI tool
CSV outputNeeds helper (like this site)Built-in @csv and @tsv
Learning curveSimple expressions, functionsPowerful but steeper
Use in appsLightweight library bindingsUsually shell-only
StreamingNot streamingSupports streaming and large files
AWS CLINative with --queryRequires piping output to jq

Which to use?

AWS CLI guide →

AWS CLI quick filter

Best: JMESPath

No extra install; use --query directly and export with our CSV tool.

Massive log crunching on server

Best: jq

Streaming and filters excel on huge files.

Application-level JSON transforms

Best: JMESPath

Embed in Python/JS/Go/Java; small dependency footprint.

One-off CLI data wrangling

Best: jq

Rich operators, regex, math, and CSV formatting inline.

Sample commands

JMESPath

aws ec2 describe-instances --query "Reservations[].Instances[].{Id:InstanceId,State:State.Name}" --output json
# Export to CSV with our JMESPath create CSV tool

jq

aws ec2 describe-instances \
  | jq -r '.Reservations[].Instances[] | [.InstanceId, .State.Name] | @csv' \
  > instances.csv