Blank line in IISW3C log file format
Last post Apr 29, 2004 11:25 AM by Anonymous
Apr 29, 2004 09:13 AM|Anonymous|LINK
I have a number of IISW3C (Extended Format) log files that I am attempting to parse using LogParser 2.0. I'm running this on a Windows 2000 Server machine.
On each log import, I need to update a database with the number of successful and failed rows. At certain intervals in the IISW3C log file, there is a blank line made up of a long string of empty spaces, then a line of the column headings for the log file,
then the content of the log file continues.
The problem I am having is that the LogParser application fails each time it comes across a blank line, and I can't figure out how to get it to ignore the blank line. I don't want the blank line to be reported in the database as a failed row.
Can someone please help me find a way to ignore the blank lines. I need to read all the columns out of the log file and I don't have access to change the format that is generated on a daily basis. The first column is the date column, and the LogParser
application fails as soon as it tries to convert a blank line to a date type. I have tried converting the date to a string and checking if it is blank in the where clause, but nothing seems to work. If I ignore the date column and read only the c-ip column
and use a where clause to see if the c-ip value is blank, it works fine, but I can't use that method on the date column, becuase LogParser tries to convert it to a date type immediately.
Any help would be appreciated
IISW3C input format
Apr 29, 2004 11:25 AM|Anonymous|LINK
Well, first off, these files are not "real" IISW3C files. Blank lines can't appear in IISW3C files, and that's why LP is barfing on the blank lines.
Do the column headings change in a file? If not, you can try with the "W3C" input format. I've tried with Log Parser 2.1 on a W3C file with blank lines, and it seems these are happily skipped.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at