Giter VIP home page Giter VIP logo

har2csv's Introduction

har2csv & har2tsv

Convert a HTTP Archive (HAR) file to a CSV (or TSV) using jq. Script heavily inspired by Google's har2csv (which requires node) by Ayman Farhat, and also a passing comment by Andy Davies.

The script ignores fields that are not essential for analyzing requests/responses such as content and those that might carry private information such as cookies.

Usage

Install and run

# Install jq
$ brew install jq

# Clone the repo, make sure scripts are executable
$ chmod +x har2csv.jq
$ chmod +x har2tsv.jq

# Run CSV
$ ./har2csv.jq input.har > output.csv

# Run TSV
$ ./har2tsv.jq input.har > output.tsv

Generating a HAR file from a browser session

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”

Extracted log entry fields

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.content.compression responseContentSizeCompression
response.content._transferSize responseTransferSize
response.headers.name['content-type'] responseContentType
response.headers.name['content-length'] responseContentLength
response.headers.name['cache-control'] responseCacheControl
time time
timings.blocked blocked
timings.dns dns
timings.connect connect
timings.ssl ssl
timings.send send
timings.wait wait
timings.receive receive
timings._blocked_queuing blockedqueueing

Note: Entries that don't match the above fields / paths are not included in the result CSV/TSV files

Useful links

Licence

Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.

har2csv's People

Contributors

bhannebipro avatar kevinfarrugia avatar nooshu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.