In "Conversion Mode", Log Parser is used to execute built-in queries to convert log files between the following formats:
Conversion mode is activated by the "-c" switch.The general syntax of commands in conversion mode is:
LogParser |
For more information on log file format conversions, refer to Converting File Formats.
C:\>LogParser -c -i:IISW3C -o:IIS extend1.log inetsv1.logDifferently than Query Execution Mode, the input format specification is a mandatory argument for commands in conversion mode.
C:\>LogParser -c -i:IISW3C -o:IIS extend1.log inetsv1.logDifferently than Query Execution Mode, the output format specification is a mandatory argument for commands in conversion mode.
C:\>LogParser -c -i:IISW3C -o:IIS "extend1.log, <1>" inetsv1.log
C:\>LogParser -c -i:IISW3C -o:IIS extend1.log "C:\My Folder\inetsv1.log"
C:\>LogParser -c -i:IISW3C -o:IIS extend1.log inetsv1.log "WHERE sc-status BETWEEN 200 AND 399"
C:\>LogParser -c -i:IISW3C -o:IIS extend1.log inetsv1.log -iCodepage:932For more information on input format parameters, refer to the Input Format Reference.
C:\>LogParser -c -i:IISW3C -o:IIS extend1.log inetsv1.log -fileMode:1For more information on output format parameters, refer to the Output Format Reference.
C:\>LogParser -c -i:BIN -o:W3C raw1.ibl C:\NewLogs\W3SVC*\extend1.log -multiSite:ON
The following example uses the "-queryInfo" switch to display diagnostic information about the specified conversion command:
C:\>LogParser -c -i:IISW3C -o:IIS extend1.log inetsv1.log -queryInfoThe output of this command is:
Query: SELECT [c-ip], [cs-username], TO_DATE(TO_LOCALTIME(TO_TIMESTAMP([date], [time]))), TO_TIME(TO_LOCALTIME(TO_TIMESTAMP([date], [time]))), [s-sitename], [s-computername], [s-ip], [time-taken], [sc-bytes], [cs-bytes], [sc-status], [sc-win32-status], [cs-method], [cs-uri-stem], [cs-uri-query] INTO inetsv1.log FROM extend1.log Formats selected: Input format: IISW3C (IIS W3C Extended Log Format) Output format: IIS (IIS Log Format) Query fields: c-ip (S) cs-username (S) TO_DATE(TO_LOCALTIME(TO_TIMESTAMP(date, time))) (T) TO_TIME(TO_LOCALTIME(TO_TIMESTAMP(date, time))) (T) s-sitename (S) s-computername (S) s-ip (S) time-taken (I) sc-bytes (I) cs-bytes (I) sc-status (I) sc-win32-status (I) cs-method (S) cs-uri-stem (S) cs-uri-query (S)
© 2004 Microsoft Corporation. All rights reserved.