Skip to content

Instantly share code, notes, and snippets.

@photopresentr
Created December 15, 2013 16:04
Show Gist options
  • Save photopresentr/7974747 to your computer and use it in GitHub Desktop.
Save photopresentr/7974747 to your computer and use it in GitHub Desktop.
Convert HAR Archive to Siege URL List using node.js
#!/usr/bin/env node
/*
* har2siege.js
* converts a HAR file generated by chrome to an url file as required
* by the siege performance testing tool (http://www.joedog.org/siege-home/)
*
* Usage:
* - save har file in chrome. make sure extension is .json, e.g. myrequests.json
* - put the relative path as the only parameter on the command line
* - redirect STDOUT to the file you want as the urllist for siege
*
* Example: ./har2siege.js ./myrequests.json > ./urllist.txt
*/
var har = require(process.argv[2]);
var _ = require('underscore');
process.stdout.write(
_.map(har.log.entries, function(entry) {
return entry.request.url +
(entry.request.method =='POST' ? ' POST ' + entry.request.postData.text : '');
}).join('\n'));
@kuddl
Copy link

kuddl commented Jan 21, 2015

Hi.
I made an alternate Version to not use underscore .. https://gist.github.com/kuddl/5a3104b2c6e66839cf69

Thanks for your initial work!
Tobias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment