Last post Oct 01, 2013 09:01 AM by smirnov
Sep 30, 2013 03:16 PM|Paulo Ricardo|LINK
I have some web application (VS2005 and VS2010) in the department where I work running in a IIS 7 server. All of them use MasterPage.
The department manager wants to know how is the use of those applications. When users log in / log out the applications.
What's the best way to accomplish this?
Thanks for your attention.
Paulo Ricardo Ferreira
Sep 30, 2013 03:26 PM|AZMatt|LINK
I would recommend an IIS Log analyzer. There are several out there both free and paid. A pretty good free on is
http://www.weblogexpert.com/lite.htm. One of the best out there is
http://webtrends.com/ but they are pretty expensive.
Oct 01, 2013 03:01 AM|mvark|LINK
Rather than manage the analytics yourself, you can use Google Analytics instead or try one of many
free Web Analytics tools
Oct 01, 2013 03:37 AM|smirnov|LINK
If this is an intranet application then using IIS logs might be a preferable choice.
There is a free Log Parser http://www.microsoft.com/en-us/download/details.aspx?id=24659 that can be run from command prompt
LogParser.exe -i:W3C "Query" -o:CSV
and extract any info you need e.g. in csv format.
See here some examples of queries http://blogs.iis.net/carlosag/archive/2010/03/25/analyze-your-iis-log-files-favorite-log-parser-queries.aspx
If you need an automatic report, you can create a scheduled task that will run the parser e.g. every day.
As for your case I believe you can try this query
, COUNT(*) AS Hits
USING HASHSEQ(STRCAT(c-ip, [cs(User-Agent)])) AS Userid
, MIN(TO_TIMESTAMP(date, time)) AS FirstHit
, MAX(TO_TIMESTAMP(date, time)) AS LastHit
, EXTRACT_EXTENSION(cs-uri-stem) AS PageType
WHERE sc-status BETWEEN 200 AND 310
AND PageType NOT IN ('js'; 'css'; 'gif'; 'png')
GROUP BY Userid
The query depends on if you use Windows authentication (how to identify userid), if IIS creates new log every day, and what data are tracked in the log.
Hope this helps.
Oct 01, 2013 07:13 AM|Paulo Ricardo|LINK
I'm afraid this is the best approach in my case. The apps run in an intranet and I don't believe the administrators will agree with that.
Oct 01, 2013 07:18 AM|Paulo Ricardo|LINK
Do I must have SQL Server running in the server to use this solution? In this case, it's out of question because I don't have it (it's one of my struggles with the infra team).
Thanks for you attention.
Oct 01, 2013 08:52 AM|smirnov|LINK
No, there is no sql server required. You even does not need to run parser on the web server, you can copy log files to another machine and run log parser from there.
Oct 01, 2013 08:56 AM|Paulo Ricardo|LINK
Ok! And where do I get those log files from in the IIS server?
Oct 01, 2013 09:01 AM|smirnov|LINK
Typically at %SystemDrive%\inetpub\logs\LogFiles
Go to IIS, your site and go to Log Files. There is a set of options such as directory, fields, format and how often the log is updated. You might need to check what fields you have and so on.