Log Parser Plus example query

Bandwidth usage, with local dates

Returns bytes (as well as converted to KB and MB) received and sent, per date, for a Web site, with request date/time converted to local time.
Keywords:
  • iisw3c
Statement:
logparser -i:w3c -o:csv "SELECT TO_DATE(TO_LOCALTIME(TO_TIMESTAMP(date, time))) AS [LocalDate], SUM(cs-bytes) AS [Bytes received], DIV(SUM(cs-bytes), 1024) AS [KBytes received], DIV(DIV(SUM(cs-bytes), 1024), 1024) AS [MBytes received], SUM(sc-bytes) AS [Bytes sent], DIV(SUM(sc-bytes), 1024) AS [KBytes sent], DIV(DIV(SUM(sc-bytes), 1024), 1024) AS [MBytes sent], COUNT(*) AS Requests INTO Bandwidth.csv FROM u_ex1102*.log GROUP BY LocalDate ORDER BY LocalDate"
Notes: Tweaked version of 'Bandwidth usage' query, to use local times. Leave a comment on this query.

View more examples.


blog comments powered by Disqus