I am parsing IISW3C logs and looking for HTTP Status code 404 for a given date range. I have one log parser command that shows me the count of 404 errors . . .and another that shows me all output for a given date range. What I need assistance with is combining these commands so that I can see my 404 errors for whatever date range I enter.
Here is my Show 404 count command:
logparser "SELECT DISTINCT TO_LOWERCASE(cs-uri-stem) AS URL, Count(*) AS Hits FROM C:\temp\Logs\IIS\http\rawlogs\*.log WHERE sc-status=404 GROUP BY URL ORDER BY Hits DESC" -i:w3c -rtp:-1
Here is my show all with Date Range command (outputting to file)
logparser "select cs-uri-stem, sc-status from c:\temp\logs\iis\http\rawlogs\*.log where to_timestamp(date,time) between timestamp('2016-08-01 00:00:00', 'yyyy-MM-dd hh:mm:ss') and timestamp('2016-08-02 23:59:59', 'yyyy-MM-dd hh:mm:ss')" -i:iisw3c -rtp:-1>C:\temp\logs\iis\DateRange.txt
How do I combined these commands so that my output only shows my 404 counts and URI's but for a given date range?
Any help is appreciated.
Thanks,
The next parser