Created
July 9, 2010 16:27
-
-
Save j05h/469681 to your computer and use it in GitHub Desktop.
awk script to parse access logs
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
awk '{ sub(/([0-9]+\.?)+/, ":id", $3); | |
sub(/[0-9]+/, ":id", $3); | |
sub(/=.*&/, "=:param\\&", $3); | |
sub(/=.*$/, "=:param", $3); | |
sub(/\?[:a-z0-9]+$/, "", $3); | |
print $1, $2, $3, $4 | |
}' | sort | uniq -c | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An awk script to parse access logs and strip out ids and parameters to make URLs generic and sortable, uniqueable.