Command-Line Operation

Log Parser

Command-Line Operation

The Log Parser command-line executable is a single, standalone binary file ("LogParser.exe") that can be used from the Windows command-line shell to execute queries and perform other Log Parser tasks.
The executable binary does not require any installation; once copied to a computer, it is ready to use.

Tip: If you want to run LogParser.exe from any directory without having to specify the absolute or relative path, you can add the Log Parser directory location to the "PATH" environment variable.

The Log Parser command-line executable works on commands supplied by the user. Commands are combinations of switches, or arguments, that specify parameters for the task that needs to be executed.
The switches used with the Log Parser command-line executable must be entered with a dash character (-) followed by the switch name, as in the following example:

C:\>LogParser -h
Most switches require a user-supplied value; in these cases, the switch name must be followed by a colon character (:) and by the user-supplied value with no intervening spaces, as in the following example:
C:\>LogParser -iCodepage:931
If the user-supplied value contains spaces, the value can be surround by double-quote characters ("), as in the following example:
C:\>LogParser -chartTitle:"Top 20 Pages"


Depending on the switches used in a command, the Log Parser command-line executable can be used in four different modes of operation:

  • Query Execution Mode: this is the default mode of operation; in this mode, Log Parser is used to execute queries reading input records from an input format and writing output records to an output format.
  • Conversion Mode: in this mode, activated by the "-c" switch, Log Parser is used to execute built-in queries that convert log files between supported log file formats.
  • Defaults Override Mode: in this mode, activated by the "-saveDefaults" switch, users can override the default behavior of Log Parser by specifying custom default values for the execution parameters.
  • Help Mode: in this mode, activated by the "-h" switch, the command-line executable can be used to display to the console window a "quick reference" help on selected topics, such as information on input and output formats, syntax of functions, and syntax of the Log Parser SQL-Like query language.


See also:

Global Switches Reference
Commands and Queries


© 2004 Microsoft Corporation. All rights reserved.