Blog Home  Home RSS 2.0 Atom 1.0 CDF  
Hairy Spider Blog - LogParser
A web of intrigue
 
 Friday, January 21, 2005

Having read Scott Hanselman's entry I thought it would be interesting to extend his script and produce a history of subscribers.

I don't have too much traffic so I can afford to store all my logfiles and found that the following script can parse all the logs and return a count of those subscribers, currently Bloglines and NewsGatorOnline, and the date that the count changed.

logparser -i:IISW3C "SELECT SUBSTR(cs(User-Agent), 0, INDEX_OF(cs(User-Agent), '/')) as Agent, TO_INT(SUBSTR(cs(User-Agent), ADD(INDEX_OF(cs(User-Agent), ';+'), 2), INDEX_OF(SUBSTR(cs(User-Agent), ADD(INDEX_OF(cs(User-Agent), ';+'), 2)), '+'))) as Subscribers, MIN(TO_TIMESTAMP(date, time)) as FromDate from d:\logs\*.log WHERE cs(User-Agent) LIKE '%subscribers%)' GROUP BY cs(User-Agent) ORDER BY Agent, FromDate desc"

1/21/2005 10:18:44 AM (GMT Standard Time, UTC+00:00)  #      LogParser  | 
Copyright © 2008 Rhys Jeremiah. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: