Previous | Next |
The PERL ParseLog Script Sample assumes you are familiar with PERL scripts and their usage. To use this sample, you need the Microsoft® Windows NT® Resource Kit and Microsoft® Windows® NT 4.0, Supplement 3.05 Kit, or PERL program and support libraries. ParseLog.pl is located in the PERL directory. The default path is C:\Program Files\Windows Media Components\SDK\Samples\PERL\ParseLog.pl.
To associate the .pl PERL script extension and the PerlScript program, run the Windows assoc and fType commands from the command line. For example, the following command associates the PerlScript file type with the PERL program:
C:>fType PerlScript = perl.exe %1 %*
The following command associates the .pl extension with the PerlScript file type:
C:>assoc .pl = PerlScript
After these associations are made, you can run the PERL script by typing the script name followed by the name of the log file. If you want a number of log files parsed into one report, place all of the files in one directory, and type the directory name instead of an individual file name. The following switches can be added in the command line to sort information:
Switch | Description |
-h | Lists URL hits in sorted order. |
-c | Lists client IP information in sorted order. |
Add one of the following options to a switch to define the order in which the information is sorted:
Option | Description |
:t | Sorts by total hits. |
:a | Sorts alphabetically. |
:u | Sorts by unique hits. |
The following command calls ParseLog.pl, assigns an input file to ParseLog.pl, and adds display criteria. The output of the process appears on your screen or console.
C:>ParseLog.pl [-h[:SortOrder]] [-c[:SortOrder]] <input file or directory>
See Also
About the PERL ParseLog Script Sample, Log Analysis Script Sample, Windows Media Technologies Solutions Samples
Previous | Next |