Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a number of legacy domain names that are setup as a site in IIS7. This site then forwards those domain names to the new domain name. The logs of the legacy sites store the name of the legacy domain that had been referenced.

We would like to run a report that shows the raw number of times each of the legacy domains have been hit. We can install new software to capture this info or we can parse the current IIS7 logs to do this.

Any ideas about the easiest approach to get this information?

share|improve this question

If you have access to the logs the easiest thing is to use LogParser for that:

It is very easy to use if you are familiar with SQL, you can run SQL-like queries against the raw log files and it is very fast (as fast as your drive allows), and you can easily group by columns, generate charts and more.

I did a blog on some samples at:

share|improve this answer

It would depend on how you do the forwarding and logging. If you return status code 301 or 302 for redirects and only for those domains and have that logged you can just count those. Another option would be to log the host header (this can be enabled in w3c logging) and just query that.

share|improve this answer

In Powershell:

Select-String sitehostname logfile|Measure-Object

Simple and effective (equivalent to grep and wc -l), but it's not the fastest for a lot of domains or regular runs. If this is a regularly-run report, you'll probably want to use something that will parse them all in one pass and depending on report duration keep log data/summary data in some sort of index.

share|improve this answer

Your Answer


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.