Last active
January 2, 2023 18:16
-
-
Save jonjensen/74523a893eea239a6155ead9d236fe33 to your computer and use it in GitHub Desktop.
Script to extract hostnames from request URLs in HAR files from Firefox & Chrome
This file contains hidden or 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
#!/bin/bash | |
set -e -u -o pipefail | |
# Include user's home directory bin/ to use locally-installed jq | |
PATH=~/bin:$PATH | |
for f in "$@" | |
do | |
echo "Unique hostnames found in request URLs in: $f" | |
jq -r '.log.entries[].request.url' < "$f" | perl -pe 's,^\w+://,,; s,/.*,,;' | sort -u | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment