-
-
Save ansell/3f40f066b76a1df7ab849cc695bdfa91 to your computer and use it in GitHub Desktop.
Shell one-liner to parse apache access logs and extract a unique URL list with hit count, querystring excluded.
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
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sed 's/\?.*//g' | sort | uniq -c | sort -rn > url_hits.txt | |
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sort | uniq -c | sort -rn > url_with_paths_hits.txt | |
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' > raw_url_with_paths.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment