Created
May 27, 2021 14:35
-
-
Save kbence/576d535865d0a7ee9fa400204ed80736 to your computer and use it in GitHub Desktop.
Jq script to convert HAR files to vegeta requests (GET only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jq -r --from-file | |
.log.entries[].request | |
| select(.url | contains("example.com")) | |
| select(.method == "GET") | |
| .method + " " + .url + "\n" + | |
( | |
[ | |
.headers[] | |
| select(.name | startswith(":") == false) | |
| select(.value != "") | |
| .name + ": " + .value | |
] | |
| join("\n") | |
) + | |
"\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage (sending realistic traffic based on a HAR file):