Log Parser Plus example query

Request time

Returns the number of times a particular page (in this case .as* files) was hit, with the average, minimum, and maximum time taken, along with the standard deviation.
  • iisw3c
logparser -i:iisw3c -o:csv "SELECT TO_LOWERCASE(cs-uri-stem) AS csUriStem, COUNT(*) AS Hits, DIV ( MUL(1.0, SUM(time-taken)), Hits ) AS AvgTime, SQRROOT ( SUB ( DIV ( MUL(1.0, SUM(SQR(time-taken)) ), Hits ) , SQR(AvgTime) ) ) AS StDev, Max(time-taken) AS Max, Min(time-taken) AS Min, TO_REAL(STRCAT(TO_STRING(sc-status), STRCAT('.', TO_STRING(sc-substatus)))) AS Status, Min(TO_LOCALTIME(date)) AS LastUpdate INTO TimeTaken.csv FROM *ex1106*.log WHERE cs-uri-stem like '%.as%' GROUP BY TO_LOWERCASE(cs-uri-stem), TO_REAL(STRCAT(TO_STRING(sc-status), STRCAT('.', TO_STRING(sc-substatus)))) HAVING COUNT(*) > 2"
Notes: Query written and provided by Chevis L. Nelson (drcheeves [at] yahoo.com). Of particular note is StDev, which Chevis wrote to find the standard deviation with one query, and which has been tested against Microsoft SQL's STDEV function. Leave a comment on this query.

View more examples.

blog comments powered by Disqus