I recently came across Microsoft Log Parser. It is an amazing tool. I am parsing Exchange Receive connector protocol logs but I encounter this error with IISW3C format.
C:\TEMP>logparser "SELECT * FROM RECV20170706-1.LOG" -i:IISW3C
Task completed with parse errors.
Parse errors:
4 parse errors occurred during processing (To see details about the parse
error(s), execute the command again with a non-zero value for the "-e"
argument)
Statistics:
-----------
Elements processed: 0
Elements output: 0
Execution time: 0.06 seconds
Using -e
does not fix it
C:\TEMP>logparser "SELECT * FROM RECV20170706-1.LOG" -i:IISW3C -e 5
Task completed with parse errors.
Parse errors:
Cannot find '#Fields' directive in header of file "C:\TEMP\RECV20170706-1.LOG". Lines 1 to 1 have been ignored
Error while parsing Date directive: missing space between Date and Time LogFile "C:\TEMP\RECV20170706-1.LOG", Row number 4, Directive '#Date:2017-07-06T00:00:04.363Z #Fields'
Unknown field date-time,connector-id,session-id,sequence-number,local-endpoint,remote-endpoint,event,data,context found in #Fields directive
Cannot find '#Fields' directive in header of file "C:\TEMP\RECV20170706-1.LOG". Lines 6 to 39711 have been ignored
I tried all input formats supported by Log Parser 2.2 (IISW3C, NCSA, IIS, IISODBC, BIN, IISMSID, HTTPERR, URLSCAN, CSV, TSV, W3C, XML, EVT, ETW, NETMON, REG, ADS, TEXTLINE, TEXTWORD, FS, COM). I encounter similar errors with other formats. I can use the GUI tool, Log Parser Studio with no difficulty but I prefer using the command line. I noticed the GUI uses a different input format, EELLog to parse.
These are my questions;
- Is the Exchange-Extensible-Logging the only accepted format?
- Can I get EEL input-format as an add-on for the command line utility?
- Is there a command line switch or another executable with the Log Parser Studio which allows me to run it on CMD?
- Can I modify the headers and directives a little and achieve a successful rendering with
IISW3C
format?
Updates
Error when using -i:w3c
C:\TEMP>logparser -i:w3c "SELECT [data] FROM RECV20170705-1.LOG"
Error: SELECT clause: Syntax Error: unknown field 'data'.
The closest match for input format 'W3C' is 'date-time,connector-id,session-id,sequence-number,local-endpoint,remote-endpoint,event,data,context'.
To see valid fields for the W3C input format type:
LogParser -h -i:W3C
LogParser -h -i:W3C
.