Created
August 2, 2016 11:12
-
-
Save dancmeyers/5e2432366f63795356a55ed21b944093 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
cat <INPUT FILE> | awk '{ bucket = int(($NUM) / <BUCKET SIZE>) * <BUCKET SIZE> ; arr[bucket]++} END { for (i in arr) {print i, arr[i] }}' | sort -g | |
# e.g. | |
# | |
# cat access.log.app025.26072016.txt | awk '{ bucket = int(($6 / 1000000) / 100) * 100 ; arr[bucket]++} END { for (i in arr) {print i, arr[i] }}' | sort -g | |
# $6 / 1000000 because apache request times are microseconds by default | |
# bucket '0' is 0-100, '100' is 100-200, etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment