« Previous Next »

Thread: Time taken, website hits, ip hits

Last post 11-12-2008 8:20 AM by qbernard. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 11-12-2008, 1:42 AM

    Time taken, website hits, ip hits

    Hi,

    I need help with Log parser scripts for

    1. time taken to load a url for all urls say for the last one week

    2. top ten websites last one week/month

    3. top ten ip's for a given day

    Is there anyway to run these scripts like a batch once a day or something

    Would appreciate any help

    thanks

  • 11-12-2008, 7:51 AM In reply to

    Re: Time taken, website hits, ip hits

    Wow, you just expect the full script here? I will give you examples from the book only, you will need to customize it per your needs.

     1) ---Ch02Top10WebRequests.sql---
    SELECT
        TOP 10
        STRCAT(EXTRACT_PATH(cs-uri-stem),'/') AS RequestPath,
        EXTRACT_FILENAME(cs-uri-stem) AS RequestedFile,
        COUNT(*) AS Hits,
        MAX(time-taken) AS MaxTime,
        AVG(time-taken) AS AvgTime,
        AVG(sc-bytes) AS AvgBytesSent
    FROM %source% TO %destination%
    GROUP BY cs-uri-stem
    ORDER BY MaxTime, TotalHits DESC
    ---Ch02Top10WebRequests.sql---

     2) Unless you are doing centralized w3c logging, else you will need to copy/rename all those website log files into a directory then run it.

     3) C:\Temp\Tools\Logparser>LogParser.exe -i:w3c "select top 10 c-ip as IP, count(*)
     as Hits from *.log group by IP order by hits desc" -o:NAT

     Tweak the script a bit then schedule it in a batch file accordingly

    Cheers,
    Bernard Cheah
  • 11-12-2008, 8:13 AM In reply to

    Re: Time taken, website hits, ip hits

    All the log parser stuff is based on SQL. Learn basic SQL queries and go from there. The specifics we can help you out more here.

    All that said for your second one I think you will be able to collate a lot of different logs together in the query. I have done this collating multiple servers on a webfarm and I don't see a problem having even more paths of logs. I don't think you will need to copy/rename website log files as bernard suggests.

     

  • 11-12-2008, 8:20 AM In reply to

    Re: Time taken, website hits, ip hits

    Ha! that's possible as well, just remember the location path and use sitename to differentiate each.

    Cheers,
    Bernard Cheah
Page 1 of 1 (4 items)
Microsoft Communities