I spent too long writing explicit paths through a deeply nested response. The useful discovery in my original note was ..: jq can visit the values below the current input without making me spell out every branch.

01 / FIELD NOTESRecursive descent

The original command was:

Original AWS pipeline · input shape not verified / Shell
# every value under any "arn" key, at any depth
aws ec2 describe-instances | jq '.. | .arn? // empty'
Source excerpt · not executed in this design sample · scroll code horizontally on narrow screens

The jq expression and the AWS command supplying its input are separate things to verify. A recursive walk cannot invent a lowercase arn field that is absent from the response.

Technical check: the AWS describe-instances reference documents a structured response with case-sensitive field names, including Arn in relevant nested objects. The original shell pipeline is retained as published, but it is not a reliable fixture for demonstrating matches on lowercase arn. No AWS command is run by this page.

02 / FIELD NOTESTry a small input you can inspect

INTERACTIVE / BOUNDED JSON WALK

Find the field. See the path.

Use fictional data only. This is a local explanation of two fixed queries, not a jq interpreter.

.. | .arn? // empty
MATCHES / EXACT LOWERCASE KEY
arn:example:hub:root

Four non-null/non-false sample values. Zero remains a value.

The capitalized Arn field is not a match.

SELECTED MATCH$["arn"]
"arn:example:hub:root"
New fictional fixture and bounded JavaScript traversal; matching values are checked separately against jq in the test suite. Nothing runs a shell or contacts AWS.
Read the figure without interaction

Recursive descent visits nested values. Optional arn lookup tolerates other node types. The fallback drops false and null, but keeps zero. The second demonstration adds a string guard before contains("ec2"). Keys are case-sensitive. Inputs and outputs stay in this page, with no persistence.

The editor starts with fictional data containing lowercase arn keys, a capitalized Arn, null, false, and zero. It runs only two fixed local demonstrations. It is not a general jq interpreter, an AWS client, or a place to paste credentials.

Use the result selector to move through the matching paths. The input stays in memory on this page; reset restores the example. The browser demonstration enforces size and depth limits instead of claiming to accept arbitrarily large JSON.

03 / FIELD NOTESThe question mark and the fallback do different jobs

In the jq manual, .. recursively emits values and .arn? performs an optional lookup. The // operator excludes both null and false; it does not drop zero just because zero is falsy in some other languages.

That last detail was incomplete in the original explanation. The example deliberately includes all three so the difference can be seen rather than memorized.

04 / FIELD NOTESKeep the substring filter honest about types

The second original excerpt was:

Original substring pipeline · assumes matching types / Shell
aws ec2 describe-instances | jq '.. | .arn? // empty | select(contains("ec2"))'
Source excerpt · not executed in this design sample · scroll code horizontally on narrow screens

It assumes values reaching contains("ec2") have an appropriate type. The new “EC2 strings” demonstration adds strings before that test:

.. | .arn? // empty | strings | select(contains("ec2"))

That guard is a new, explicitly identified example—not an invisible edit to the published command. It also checks a substring, not whether an ARN is authentic or belongs to an accessible resource.

The useful habit is small: inspect a response's shape, write a tiny fixture, and test the expression against it. Recursive descent saves the path-writing; it does not remove the need to understand the data.

Source, dates, and what this page verifies

Based on the complete supplied project/article account. Original publication dates and source URLs are retained. This is an edited reference, not a published update or a new audit of the original application.

Official technical clarifications checked September 29, 2026 are explicitly marked and linked beside the relevant passages. They are distinct from the original author's historical claims. The jq and Docker excerpts remain unchanged and carry their source limitations.

New interactive examples are bounded local teaching tools; they do not scan a website, process credentials, contact AWS, build an image or report a production measurement. No repository, staff account, service terms, résumé, price or live backend was changed.

See docs/batch-6/SOURCE-REVIEW.md for the separation of source-derived claims, external documentation and authored illustrations.

Original published source ↗