Git Product home page Git Product logo

har2csv's Introduction

Har2CSV

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.

Usage

Install and run

Requires node v10.13.x or above

# Install

npm install har2csv -g

# Run

har2csv path/to/input.har path/to/output.csv

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.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

WIP

  • Support TSV format
  • Add flag for excluding columns from the result
  • Output stats from the conversion e.g. # of requests, GET vs POST etc...

License

Apache 2.0

Contributors

Disclaimer

This is not an official Google product.

har2csv's People

Contributors

aymanfarhat avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

har2csv's Issues

wss:// requests are skipped

Great easy to use tool. I noticed however that websocket requests (wss:// , ws//: ) are skipped and not outputted to the CSV file.

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.