nitefood / asn

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / URL / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup API server / Web traceroute server
MIT License
1.31k stars 159 forks source link

CSV format #32

Closed abensimon86 closed 2 years ago

abensimon86 commented 2 years ago

It's possible to get output as CSV/Xls ?

nitefood commented 2 years ago

Sorry for the late reply. I have no plans on supporting CSV, since what would be the column headers vary greatly according to what type of lookup you're running. For instance you'll get widly different fields if you're looking up an IP or an AS number. JSON, on the other hand, lends itself perfectly to this type of scenarios.

Regarding XLS, the same principle applies. Unless you meant XML, which I deem unnecessary anyway, given the ubiquity of (again) JSON.

That said, if you really, really need CSV output, you can still instruct jq to convert JSON->CSV. Just run the tool using the -j or -J switch and pipe the output into jq, as described here or here. There are countless examples out there.

Have fun!