|W3c Logs With Percentage Downloaded|
Trying to show only files where 30+% was downloaded.
| 6:36 pm on Mar 29, 2011 (gmt 0)|
First, I wasn't sure if this should be in Logging, IIS, or Database. Please move if inappropriate.
We host .mp3 and .wmv files. I'm tasked with getting monthly download statistics (which would be very simple), except they want to know how many files are being downloaded, at least, 30% or more of the file. The percentage is supposed to remove those people that left-click on the link and it starts playing, only to then close the player. They want to see legitimate downloads.
We have IIS (Windows Server 2008 R2) logging with the W3c format. I see no file size or amount downloaded statistics. The closest thing that I see is the transfer time (time-taken) field, but that can be radically different from file to file.
Are there any simple ways of doing this? I was thinking that, if a filesize and size downloaded was included, I could do a calculation to base the report on that, but they aren't included.
| 6:59 pm on Mar 29, 2011 (gmt 0)|
I was looking at our windows media streaming server and it does have some of that functionality (filesize and sc-bytes/c-bytes).
It looks like, though, that streaming server uses a windows media logging format.
| 8:52 pm on Mar 29, 2011 (gmt 0)|
Another thing I just realized is that I don't think my logs are showing any 206 status entries. Everything is either 200 or 404.
That doesn't seem realistic. Is it possible that my logs are rejecting 206? If that's the case, then these statistics could be very simple.
| 9:23 pm on Mar 29, 2011 (gmt 0)|
Well, that's irritating...
The logs show all transfers as 200.
I left-clicked on a wmv and it opened windows media player. As soon as it started playing, I closed windows media player and the logs show it as 200.
I right-clicked and save as and the file started downloading. I cancelled the download after 100MB and the logs show it as 200.
I did figure out how to add sc-bytes (server to client transferred). I think I'm going to have to do a calculation based upon the bytes sent and the average filesize for each type of file. Thankfully, the files are split up into directories in such a fashion that similar filesizes are together.
| 2:47 pm on Mar 31, 2011 (gmt 0)|
This is what I ended up with. I think it works pretty well, but I don't really have a basis to judge. I'll have to wait until the end of next month to be able to compare figure with past stats.
This is using logparser to run sql statements on the IIS logs. I had to enable logging of sc-bytes in IIS before it would work.
Note the %music%.mp3. The logs will show /music/BlehBlehBleh.mp3, but I wanted to make sure that anything with "music" and ".mp3" would show up.
Also note the sc-byte >= 1377915. That's 30% of the average filesize of all the music mp3s on that server.
"C:\Program Files (x86)\Log Parser 2.2\LogParser.exe" "SELECT COUNT(cs-uri-stem) FROM c:\inetpub\logs\logfiles\w3svc1\u_ex1104*.log WHERE sc-status=200 AND cs-uri-stem LIKE '%music%.mp3' AND sc-bytes >= 1377915" -i:W3C -o:W3C