#!/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
