Run brew install gnu-sed on OSX and replace sed with gsed in the command below. sed -r "s/.*(GET|POST|HEAD|PROPFIND) ([^\?]*?)(\?.*?)? HTTP.*/\2/" \ access_log | grep -v "^/$" | sort | uniq -u