Iis – TO_TIMESTAMP(date, time) missing seconds

iislogginglogparser

When I run log parser using the code below I get the data and time field together as expected but it is missing the seconds. How do you get it to also list the seconds? The two fields look like,

date               time
3/13/2013       0:00:02

Once I run it using the code below it looks like this but is missing the seconds,

timestamp
3/13/2013 0:00

LogParser "SELECT  TO_TIMESTAMP(date, time) as timestamp INTO iisLog.csv FROM \\appdev1\c$\inetpub\logs\LogFiles\W3SVC1\u_ex130313.log" -i:iisW3C -o:csv

Best Answer

Those date and time fields do not look to be of type TIMESTAMP, they've been likely parsed as STRING types. Use TO_TIMESTAMP(STRCAT(date, ' ', time), 'M/dd/yyyy H:mm:ss').

Related Topic