Convert HTTP session HAR file logs into CSV format
This CLI tool provides you with an easy way to convert HAR file HTTP log entries into a flat CSV format to make it easier to analyze. The utility ignores fields that are not essential for analyzing requests/responses such as content and those that might carry private information such as cookies.
Requires node v10.13.x or above
# Install
npm install har2csv -g
# Run
har2csv path/to/input.har path/to/output.csv
Example using Chrome:
- Open the Dev Tools panel via Ctrl + Shift + i
- Click the “Network” menu item on the top menu bar of the panel
- The HTTP session is recorded by default, navigate to the pages / resources you're inspecting
- Once ready to export the data, right-click anywhere on the list of items in the Network resource list and select “Save all as HAR with content”
| Entry path | CSV column name |
|---|---|
| pageref | pageRef |
| startedDateTime | startedDateTime |
| request.method | requestMethod |
| request.url | requestUrl |
| request.httpVersion | requestHttpVersion |
| request.headerSize | requestHeaderSize |
| request.bodySize | requestBodySize |
| response.status | responseStatus |
| response.content.size | responseContentSize |
| response.headers.name['content-type'] | responseContentType |
| response.headers.name['content-length'] | responseContentType |
| response.headers.name['cache-control'] | responseCacheControl |
| timings.blocked | blocked |
| timings.dns | dns |
| timings.ssl | ssl |
| timings.connect | connect |
| timings.send | send |
| timings.wait | wait |
| timings.receive | receive |
| time | time |
Note: Entries that don't match the above fields / paths are not included in the result CSV file
- Support TSV format
- Add flag for excluding columns from the result
- Output stats from the conversion e.g. # of requests, GET vs POST etc...
This is not an official Google product.