I'm trying to count the number of requests my nginx reverse proxies served in the last 30 days. I'm doing this by counting all the lines in access logs plus the rotated access logs. I have logs for 30 days.
cd /var/log/nginx
for file in access.log*.gz; do zcat $file | wc -l; done
wc -l access.log
Then I sum all the resultant numbers. Should I also add the lines in error log to this? Are there any better ways to calculate the total number of requests? Are there any pitfalls I should know about?