Deutsch | English
This blog does not contain official statements of, only personal opinions of the individual contributors.

Transforming JSON to CSV


CERTs are all about processing information security notifications. Most of the time, these arrive in the form of CSV files. However, occasionally we do get some JSON data. While CSV is line oriented, JSON allows for more complex structures (arrays, objects, objects in objects, etc.)

So how to you easily transform complex JSON structures to CSV? Most programmers would look at the specific JSON format and start writing a converter. However, there is a smarter way: JQ!

JQ is a JSON filter / transform mechanism.

To quote JQ's homepage: "A jq program is a 'filter': it takes an input, and produces an output. There are a lot of builtin filters for extracting a particular field of an object, or converting a number to a string, or various other standard tasks."

In short: JQ is like awk and xargs for JSON. Mightly practical stuff!

Author: L. Aaron Kaplan

Phone: +43 1 5056416 78
more ...
MeliCERTes Training in Vienna
2019/03/14 | From March ...
New PGP-Keys
2019/03/13 | Since our ...
more ...
Last Change: 2014/6/14 - 20:23:12
Haftungsausschluss / Data Protection & Privacy Policy