Having identified all of the different log files that are available, and having selected those that they will use, Fabrikam needed a quick and easy way to consolidate all of the log files from the servers into a cohesive report. The solution? A script file.
Parselog.js is a simple script file that runs from a command window and shows how Windows Media Services log files can be processed to generate detailed information about the usage of your server. You can use the script to parse individual log files from unicast, multicast, or cache/proxy servers, or you can specify a directory that contains all of the log files and let the script aggregate the results into the report. The script file can be used with log files from both Windows Media Services 4.1 and Windows Media Services 9 Series, so if you have both types of media servers in your enterprise, you can compare statistics between them.
If you are using the script with a directory of log files, it identifies Windows Media Services log files by the first three characters of the file name, and will use any appropriate files that have names starting with WMS. This is the default naming scheme used by the logging plug-ins.
Parselog.js provides summary information such as reception statistics, types of client operating systems, and URL hits sorted in three different ways: by total hits, by unique client hits, and alphabetically.
Parselog.js is available on the CD provided with this book.
Follow these steps to run the Parselog.js script on log files created by Windows Media Services:
Place the Parselog.js file on a computer that has log files you want to analyze.
Open the command window on the computer.
In the command window, change directories to the location of the Parselog.js file. For example, Fabrikam created a special folder off the root drive named Logs, so they typed “cd c:\Logs” at the command prompt.
Run the script by typing the command “cscript Parselog.js”, and then specifying the parameters you want to use.
Parselog.js uses the following command-line syntax:
cscript Parselog.js [[/url:sortorder] [/ip:sortorder] [/summary]] input_file
Command-line parameters supported by the Parselog.js script are described in the following table:
Parameter | Description |
---|---|
/url: sortorder | Organizes the detail section of the report by the number of client requests per publishing point connection URL. |
/ip: sortorder | Organizes the detail section of the report by the client IP addresses. |
sortorder | Defines the way in which the detail information is displayed. Type one of the following characters to specify the sort order you want: |
/summary | Specifies that the report should only display summary statistics. |
input_file | Specifies what data the script should parse. The input must be specified as a path. The path can be to an individual log file or to a directory that contains multiple log files. If the path contains spaces, make sure to enclose the path in quotation marks. |
For example, Fabrikam wants the report to be sorted by the number of client requests and wants to include all of the log files in their log file folder, so they type the following at the command prompt:
cscript Parselog.js /url:u c:\LogFiles.log
Figure 23.2 shows an example that was generated by using this tool on Fabrikam’s log files:
Figure 23.2: Summary report produced by ParseLog.js.