If you notice that the time logged in IIS logs does not match your server's local time, this is because IIS logs time in UTC (GMT) to conform with the W3C log format so if you are in a different time zone for example UTC -3 you will find the time 3 hours ahead in the logs.
To change that, you can choose a different log format from the IIS manager or you can convert the log file using Log Parser.
Download and install Log Parser then run the following command
LogParser.exe "SELECT DATE,TO_LOCALTIME(time) AS time,s-ip,cs-method,cs-uri-stem,cs-uri-query,s-port,cs-username,c-ip,cs(User-Agent),sc-status,sc-substatus,sc-win32-status,time-taken INTO c:\ayman\output.log FROM c:\ayman\input.log" -i:IISW3C -o:W3C
To change that, you can choose a different log format from the IIS manager or you can convert the log file using Log Parser.
Download and install Log Parser then run the following command
LogParser.exe "SELECT DATE,TO_LOCALTIME(time) AS time,s-ip,cs-method,cs-uri-stem,cs-uri-query,s-port,cs-username,c-ip,cs(User-Agent),sc-status,sc-substatus,sc-win32-status,time-taken INTO c:\ayman\output.log FROM c:\ayman\input.log" -i:IISW3C -o:W3C
Thank you for that, worked for me!
ReplyDeleteGreat helped!
ReplyDeleteThis is very helpful but I encountered an issue: although the time correctly converts, the date would not change when crossing midnight (GMT) into the next date.
ReplyDeleteTo fix this, replace the DATE parameter with the following:
TO_DATE(TO_LOCALTIME(TO_TIMESTAMP(date,time))) AS date
bapesta shoes
ReplyDeletebape official
jordan 1
off white outlet
golden goose outlet
bape
fear of god essentials hoodie
Jordan Travis Scott
supreme outlet
air jordan