Created
August 22, 2012 02:06
-
-
Save sheeplogh/3421464 to your computer and use it in GitHub Desktop.
grep an accesslog(apache) file within a specific time period
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 ACCESS_LOG | awk '$4 >= "[29/Jan/2012:12:00:00" && $4 < "[29/Jan/2012:13:00:00"' |
i think that script not valid because the weight of days is larger then weight of years and month
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's great. Is there a quick way to throw a bash variable in there?
eg. yesterday -
date +%d/%b/%Y --date="yesterday"
- which gives07/Apr/2019
and today -
date +%d/%b/%Y
- which gives06/Apr/2019