Count requests from access log for the last 7 days
- by RoboForm
I would like to parse an access log file and have returned the amount of requests, for the last 7 days. I have this command
cut -d'"' -f3 /var/log/apache/access.log | cut -d' ' -f2 | sort | uniq -c | sort -rg
Unfortunately, this command returns the amount of requests since the creation of the file and sorts it into HTTP-code categories. I would like just a number, no categories and only for the last 7 days.
Thanks.