Last active
August 29, 2015 13:59
-
-
Save jayankandathil/10938624 to your computer and use it in GitHub Desktop.
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 script to print unique user IDs in a folder | |
# containing a collection of CQ's access.logs | |
# ------------------------------------------------ | |
# Usage : gawk -f /opt/scripts/parse-cq-access-logs.awk /opt/aem/crx-quickstart/logs/access.log.* | |
# Author : Jayan Kandathil | |
# Last updated : April 16, 2014 | |
# Version : 0.1 | |
# Set delimiter character, Start timing | |
BEGIN { FS = " "; start_time = systime()} | |
{ | |
# Add 3rd field to array (if unique) | |
array[$3]++ | |
} | |
# Print results and total time taken | |
END { print "\n"; for (value in array) { print value }; end_time = systime(); print "\nTook " (end_time - start_time) " second(s), processed a total of " NR " lines in all files" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment