Technology Enthusiast, Software Engineer, Architect & Craftsman, DevOps Human & All Round Disney Lover

IIS Logs Parser - Get Top Hostnames by Date and Time

IIS Logs Parser - Get Top Hostnames by Date and Time

Dan Horrocks-Burgess
Dan Horrocks-Burgess

A while back I needed to parse our IIS logs to see our top hostname traffic between a specified date and time range. The simple IIS log parser snippet allows just this. Change the date and timestamp to narrow your IIS logs.

SELECT TOP 50
    cs-host,
    COUNT(*) AS Total
FROM '[LOGFILEPATH]'
WHERE
     date = '2019-01-23'
AND
    time between timestamp('10:00:00', 'hh:mm:ss') and timestamp('11:00:00', 'hh:mm:ss')
GROUP BY cs-host
ORDER BY Total DESC