Utilities
Flatten JSON into greppable assignments
Make JSON greppable.
overview
What gron does
gron turns nested JSON into one assignment per line so grep and other line tools can find values without a JSON query language.
Use --ungron to reverse the transform: keep the lines you want, rebuild valid JSON, and pass a subset downstream. --stream treats each input line as its own object; --json emits a JSON stream form.
Trickest provides it as a managed Utilities node between any JSON-emitting step and a filter that only needs a few fields from a file or URL.
source github.com/tomnomnom/gron
use cases
Where gron fits
Grep deep into JSON output
Flatten a tool's JSON into path assignments so a simple grep finds the exact nested field instead of eyeballing indented blobs.
Extract and rebuild a subset
Grep the gron lines you want, then ungron them back into valid JSON so a downstream step receives only the fields that matter.
Fetch and flatten an API response
Point gron at a URL so it pulls the JSON and flattens it in one step, ready for grep without a separate download node.
Handle JSON streams
Turn on stream mode to treat each input line as its own JSON object, flattening line-delimited JSON from another tool.
reference
gron inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| json | BOOLEAN | --json | Represent gron data as JSON stream |
| stream | BOOLEAN | --stream | Treat each line of input as a separate JSON object |
| ungron | BOOLEAN | --ungron | Reverse the operation (turn assignments back into JSON) |
| no-sort | BOOLEAN | --no-sort | Don't sort output (faster) |
| insecure | BOOLEAN | --insecure | Disable certificate validation |
| url | STRING | · | Input URL |
| file | FILE | · | Input file |
Showing key inputs. gron exposes 7 inputs in total.
example
Run gron
# gron: flatten JSON then grep a nested fieldgron --json data.json | grep 'username' json = {};json.users[0].id = 1;json.users[0].username = "alice";json.users[1].id = 2;json.users[1].username = "bob";json.meta.source = "https://api.example.com/v1";guidance
Choosing gron
Use gron to search and filter JSON with grep, then --ungron to rebuild a subset. Prefer jq when you need a query language and complex transforms. gron fits when line tools are enough.
jq
Full JSON query language for filtering and transforming. gron favors grep and flat assignments over query syntax.
unfurl
Pulls parts out of URLs rather than JSON. A sibling tomnomnom utility for a related extraction job.
json2html
Renders JSON as HTML for reports. Readable view, not greppable assignments.
faq
gron questions
related
More Utilities tools
cewl
Spider a URL and return a wordlist for password crackers.
dnsgen
Wordlist and mined-word subdomain permutation.
pup
CSS selectors over HTML, the jq counterpart for markup.
unfurl
Extract chosen URL parts from stdin into clean line lists.
whisper
Speech to txt, vtt, srt, and json from an audio file or folder.
youtube-transcript
Public caption tracks to transcript.txt and results.jsonl.
Run gron yourself
A JSON input feeds gron, which flattens it into greppable assignments and writes the extracted fields as a queryable output.
Facts on this page come from the live Trickest tool library.