Last active
January 15, 2018 08:52
-
-
Save joelabair/7357558 to your computer and use it in GitHub Desktop.
Average Request Size from apache log file (common log format) in AWK. (one line)
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 'BEGIN { t = 0; c = 0 } { if($10 ~ /[[:digit:]]/) { t = t + $10; c++; } } END { print t / c}' /var/log/httpd/access_log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AWK - language of the gods.