Last active
August 29, 2015 14:03
-
-
Save prakhar1989/9f2e25b6564b8411e159 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| filename=$1 | |
| for hour in {0..23} | |
| do | |
| for minute in {0..59} | |
| do | |
| if [ $hour -lt 10 ] | |
| then | |
| h="0$hour" | |
| else | |
| h=$hour | |
| fi | |
| if [ $minute -lt 10 ] | |
| then | |
| m="0$minute" | |
| else | |
| m=$minute | |
| fi | |
| result=$(zgrep "29/Jun/2014:$h:$m" $filename | awk '{print $1}' | sort -u | wc -l) | |
| result="$h:$m, $result" | |
| echo $result | |
| done | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
$ wget file_url $ chmod +x log.sh $ ./log.sh m.xcite-access.log.6.gz > web2_mobile.csv