RSS

Monthly Archives: October 2015

Log Parser Lizard format time for IIS log file


SELECT TOP 100
TO_STRING(TO_TIME(time), 'hh:mm:ss') AS TimeLocal,
sc-status,
* FROM 'D:\temp\w3wp.log'
where
TO_TIMESTAMP(date, time) > TIMESTAMP('2015-10-28 19:59', 'yyyy-MM-dd HH:mm')
and sc-status='500'
and
cs(User-Agent) like 'Mozilla/5.0+(Windows+NT+6.1%;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/46.0.2490.80+Safari/537.36'

if the time is in utc and you want it local first load it into To_TimeStamp then do To_LocalTime

TO_TIMESTAMP(date, time) AS utc-timestamp, TO_LOCALTIME(utc-timestamp) AS local-timestamp

Advertisements
 
Leave a comment

Posted by on October 29, 2015 in Uncategorized

 

Tags: