loading
loading
Utilities
Make JSON greppable.
overview
gron turns nested JSON into one assignment per line so grep and other line tools can find values without a JSON query language.
Ungron reverses the transform: keep the lines you want, rebuild valid JSON, and pass a subset downstream.
Point it at a file or URL between any JSON-emitting tool and a step that only needs a few fields.
source github.com/tomnomnom/gron
use cases
Flatten a tool's JSON into path assignments so a simple grep finds the exact nested field instead of eyeballing indented blobs.
Grep the gron lines you want, then ungron them back into valid JSON so a downstream step receives only the fields that matter.
Point gron at a URL so it pulls the JSON and flattens it in one step, ready for grep without a separate download node.
Turn on stream mode to treat each input line as its own JSON object, flattening line-delimited JSON from another tool.
reference
| 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
# 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
Use gron to search and filter JSON in a pipeline without writing a parser, then ungron to rebuild a subset. For path-based querying and transforms with a query language, reach for jq. gron shines when grep and shell tools are all you have.
Full JSON query language for filtering and transforming. gron favors grep and flat assignments over a query syntax.
Pulls parts out of URLs rather than JSON. A sibling tomnomnom utility for a related extraction job.
Renders JSON as an HTML view. A different way to make JSON readable, for reports rather than grep.
faq
related
Import, export, and link workflow data with Airtable.
Decode Android APK files into smali sources and resources.
Check a file's values against conditions and exit with a matching code.
Extract all hosted zones from AWS Route53.
Output file lines by batch size, given START_LINE and END_LINE.
Extract a batch range from a file's lines or a folder's files, with parallel processing.
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.