This archive is retained to ensure existing URLs remain functional. It will not contain any emails sent to this mailing list after July 1, 2024. For all messages, including those sent before and after this date, please visit the new location of the archive at https://mailman.ripe.net/archives/list/[email protected]/
[atlas] Alternative to jq: gron
- Previous message (by thread): [atlas] Join RIPE NCC IXP Tools Hackathon, 22-23 October, Madrid
- Next message (by thread): [atlas] Alternative to jq: gron
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Stephane Bortzmeyer
bortzmeyer at nic.fr
Tue Aug 16 19:02:23 CEST 2016
It seems many people here use jq to browse JSON files. I've been referred recently to gron <https://github.com/tomnomnom/gron> which is quite different: less features but probably simpler to use for beginners. Unlike jq, gron does not have a filtering language: it just formats the JSON in a way that makes simple to use traditional grep. Here is an example with measurement #4477822, a DNS one: % gron 4477822.json|more json = []; json[0] = {}; json[0].from = "178.248.214.8"; json[0].fw = 4730; json[0].group_id = 4477822; json[0].lts = 18; ... Selecting the values of the serial number is as simple as: % gron 4477822.json | grep SERIAL json[0].resultset[0].result.answers[0].SERIAL = 2223898795; json[0].resultset[1].result.answers[0].SERIAL = 2223898793; json[1].resultset[0].result.answers[0].SERIAL = 2223898790; json[1].resultset[1].result.answers[0].SERIAL = 2223898792; json[1].resultset[2].result.answers[0].SERIAL = 2223898795; json[2].resultset[0].result.answers[0].SERIAL = 2223898791; ... And you can turn back the result of the filtering into JSON.
- Previous message (by thread): [atlas] Join RIPE NCC IXP Tools Hackathon, 22-23 October, Madrid
- Next message (by thread): [atlas] Alternative to jq: gron
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]