Q:

Is it possible to tell how many times a file has been downloaded retroactively?

We have a webpage with some links to PDF files. I added the proper _trackPageview() JavaScript to each link, so that we could count our downloads through Google Analytics. Unfortunately, due to some unfortunate automatic formatting within WordPress, the code was removed from the link, and we don't have the analytics we need.
What I'm wondering is if it's at all possible, through some magic, to determine how many times these files have been downloaded from our server? Either through Apache, or Ubuntu, or via FTP, or even the WordPress DB...I don't care how. And it doesn't have to be perfect, even an estimate would help.
Is this at all possible?

A:

I ended up solving this by logging into the Linux server, navigating to where our access.log file is, and then running this command:
grep 'file-name.pdf' access.log

After a few minutes it spit out all of the lines in the log that referenced this file. I copied those lines, put them into a spreadsheet, filtered out the ones that came from our own IP address, and selected the date range I needed in order to get the number of GET requests.
Not the most elegant solution ever, and there are probably better Linux commands that give more detailed information, but this at least got me what I needed. I know that if I were to use:
grep 'file-name.pdf' access.log | wc

It would have given me the number of lines rather than the lines themselves, but since I needed to filter out IPs and dates, the former worked for me.

