Shape an az --query JMESPath expression on pasted JSON, with errors shown as you type
Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 17 Oct 2026.Every az command accepts --query with a JMESPath expression, which filters and reshapes the JSON before it reaches the screen. Paste the output of a command such as az vm list, then try [?location=='westeurope'].{name: name, size: hardwareProfile.vmSize} and see the result at once. Mistakes are shown with the character where the expression went wrong.
Paste or type your input.
Choose the options you need.
Press Ctrl+Enter, then copy or download.
JMESPath selects and reshapes JSON with one short expression. The AWS CLI, the Azure CLI, Ansible's json_query filter and many SDKs use it, so the same skill pays off in several places. Getting an expression right by rerunning a slow cloud command is painful; here you paste the saved output once and try as many expressions as you like.
Errors you can act on. A syntax mistake is reported with the character where the parser stopped. A wrong argument says which function and which argument, such as "length(): argument 1 must be string or array or object, not number." A query that matches nothing returns null, as the CLI prints it.
JMESPath or JSONPath? The two look alike but differ: JMESPath filters use [?a == 'x'] with backticks for JSON literals and can build new objects, while JSONPath starts with $. For JSONPath, use the JSONPath Tester.
The rest of the article, and all 6 questions about JMESPath Tester, are on the JMESPath Tester page.
JMESPath queries JSON: it picks fields, filters arrays and builds new objects in one expression. The AWS CLI and Azure CLI use it for their --query option, Ansible uses it in the json_query filter, and SDKs in Python, JavaScript, Go and Java ship it for searching API responses.
A field name that does not exist, a wrong letter case or applying [0] to an object gives null rather than an error. Check each step by deleting the end of the expression until a result appears; the first step that returns null is where the path stops matching the data.
Both project over an array, but [] also flattens one level of nested arrays. Reservations[*].Instances[*].InstanceId gives a list of lists, while Reservations[].Instances[].InstanceId gives one flat list, which is usually what an AWS CLI query needs.
Yes for the query itself. The AWS CLI evaluates --query with the Python JMESPath library, and this tester passes the same 892 compliance tests that library passes. Paste output saved with --output json so the data matches what the CLI filters.
Rates and rules change; check the source before you rely on a figure.
Still stuck? Ask about JMESPath Tester and anybody who knows can answer. No account needed.
Same job, other tools: JSONPath Evaluator – Evaluate a JSONPath expression and get the matching values and their paths.
On the related tools: Readability Checker – Flesch reading ease and grade level, with what to change.