Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is going to be a simple answer, I'm sure, but at the moment I am not sure what I need to do to get the answer.

I have been asked to provide some data on the total unique amount of downloads a particular PDF file on our webserver is getting.

I have IIS logging switched on so I presume the information about the file being downloaded will be in here, but I am not sure how I go about getting data from these files.

Anyone have any good suggestions on how I can go about getting this info ??

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Go get the Log Parser utility from Microsoft.

Then use something like

LOGPARSER "SELECT cs-uri-stem, count(*) from c:\weblogs\w3svc1\*.log where cs-uri-stem LIKE '%/yourfile.pdf'"

For a real simple set of output, like:

/yourfolder/yourfile.pdf     6

Also, you'll need to work out what unique means, and then adjust the totals for that. For example, a 304 probably reflects a non-unique download, so you'd potentially:

LOGPARSER -i:w3c "SELECT DISTINCT cs-uri-stem, sc-status, count(*) from c:\weblogs\w3svc1\*.log where cs-uri-stem LIKE '%/yourfile.pdf' GROUP BY cs-uri-stem, sc-status"

Edit: Web logs are (usually) just text files, one line per entry. So you don't even need to use LogParser just to get a count:

FIND "yourfile.pdf" ex_111207.log > justPDF.txt

Then open JustPDF in Excel, or get a line count in any other way.

Plus, lots of examples around. Here, here and here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.