HTTP Archive (har) to CSV converter (har2csv)
This is a small command-line application written in Java for converting HAR (HTTP Archive) files to CSV (comma separated values). It’s useful for importing web pages statistics, from a browser extension to a spreadsheet, in order to do some analysis on sizes and timings.
As all Java applications, it’s cross-platform. All you need is a JRE (Java runtime environment) properly installed. I added two executable wrappers, one for Windows systems (har2csv.exe) and a Bash script for Linux boxes (har2csv).
Usage is pretty strightforward:
har2csv --in <source> --out <destination>
Or type “
har2csv --help” to get more info.
These are the binaries (if you intend to use it right away):
And here’s the source code, in case you want to study or modify the application:
Binaries and source are also available fromGitHub, on this URL:https://github.com/spcgh0st/HarTools
NOTE: I haven’t mapped all fields from HAR specification to columns in the CSV file, because I only needed a few ones. If you need any extra data exported, feel free to contact me, and I gladly update the code.
Update 2014/03/04@2251: added “startDateTime” and “time” from Entry object, to CSV output.
Update 2014/03/11@0045: added “Referer” from Request > Headers array, to CSV output.
Update 2014/03/11@2332: fixed a bug that made the conversion to CSV, ignore floating point values in HAR file (ie. in timings).