SharePoint IIS Log parsing

IIS logs is an important location where information about your sites and web application is stored and getting information out of it may look like a complex process if you have huge log files and you tried to pen them and do manually search you are absolutely correct it is complicated by this basic approach but I have found the simple solution for you in this article that can make it easy to get data out of the IIS logs.

May be you will ask what information is important in IIS: the answer if you need to know which pages are the slowest if you need to get the Requests per hour to confirm to the management that you need or you don’t need to scale up/out, you can get the unique users visited your site, the browsers used, extra, so I am going to leave you with the steps needs to get information out of IIS and this can be applied to any other technology using IIS not only SharePoint.

Steps to get data out of IIS:

  • Download and Install Log Parser 2.2 http://www.microsoft.com/en-eg/download/details.aspx?id=24659  no need to install it on SharePoint server it can be any other machine if you would like to keep your SharePoint farm free from any other application.
  • Add ;C:\Program Files (x86)\Log Parser 2.2 to the Path environment variable (this is the path of the Log Parser 2.2 installation directory)
  • Note: to add Path environment variable  https://technet.microsoft.com/en-us/library/cc736637(v=ws.10).aspx 
  • Download the Log Parser Studio  https://gallery.technet.microsoft.com/office/Log-Parser-Studio-cd458765 and you will not need to install it just it is an exe that you will run.
  • On the machine where you will copy the logs files, create a folder called Logs.
  • Create inside Logs folder a sub folder for each front end.
  • Copy inside each sub folder the logs from the corresponding front end.
  • Create another folder call consolidated Logs.
  • In the Logs folder search for all .log extension files by typing *.log, then select all and copy them
  • Go to the consolidated log folder and paste.
  • You will find while pasting the log files that the same files names exists so do the following
  • Press let me decide for each file then put select check box on both source and destination so all files will be kept

Now open the Log parser studio exe and it will look like the following screenshot.

In the Log Parser Studio you will find queries related to IIS like top URL and slowest URLs

You need to point now to the location where the logs exists, press on the folder icon as highlighted and this will open a window for you.

Once you selected the logs path you can choose any of the existing queries or even write your own query

Double click on any of the existing queries this will open a new tab

In the new tab you will find that there is a query has been created for you

Press on the execute red button

This will generate the results as shown

In here time unit is milliseconds to get it in seconds divide by 1000.

You can select all those records copy them and paste in Excel sheet.

You can also create your own query.

Press on create new query button.

This will open a new window for you where you can write your own query and execute it.

error

Enjoy this blog? Please spread the word :)