Re: [PHP] Newbie challenge to brainiacs

2002-05-15 Thread Josh Edwards

The challenge is to do it without SQL. Which blog do you recommend?


David Jackson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jay Blanchard wrote:
 
 The burning issue that begs to be answered is, why reinvent the wheel?
 There is a least a dozen blogs on freshmeat for PHP along...
 Unless your doing it just for kicks, which is OK.

 David


  [snip]
I want to try to find the hour that has the most hits
The day of the week that has the most hits
and the max and ave  no of hits of these.
 
  I haven't given it a whole lot of thought but I'd be tempted to dump the
  whole thing into an appropriately structured sql database and then use
  SELECT's to extract the information you want.  It'll likely end up
  faster and less processor intensive than doing it in php by itself I
  suspect.
  [/snip]
 
  +1
 
  Not only that, but then you will have the ability to create queries for
  other important factors in the logs without having to recode, or create
  code.
 
  Jay



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Newbie challenge to brainiacs

2002-05-15 Thread Jason Wong

On Wednesday 15 May 2002 16:20, Josh Edwards wrote:
 The challenge is to do it without SQL. Which blog do you recommend?


 David Jackson [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  Jay Blanchard wrote:
 
  The burning issue that begs to be answered is, why reinvent the wheel?
  There is a least a dozen blogs on freshmeat for PHP along...
  Unless your doing it just for kicks, which is OK.

Not sure what blogs have to do with this? IIRC the OP was trying to analyse 
webserver log files.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Your computer hasn't been returning all the bits it gets from the Internet.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Newbie challenge to brainiacs

2002-05-14 Thread Jason Wong

On Tuesday 14 May 2002 19:42, Josh Edwards wrote:
 Here is a sample of my weblog that reads into an array from a file ie

 $filename = (combined_log);
 $fcontents = file($filename);

 203.29.154.13 - - [08/May/2002:21:21:07 +1000] GET /A1.php HTTP/1.1 200
 417 -
  Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)

To help you get started this regex will match your input lines:

/^(.+)\s(.+)\s(.+)\s\[(.+)\]\s(.+)\s(\d+)\s(.+)\s(.+)\s(.+)/

breaking them into its components:

ip
identd
user
time
request
result
size
referrer

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Gomme's Laws:
(1) A backscratcher will always find new itches.
(2) Time accelerates.
(3) The weather at home improves as soon as you go away.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Newbie challenge to brainiacs

2002-05-14 Thread David Freeman


  Here is a sample of my weblog that reads into an array from a file ie

  I want to try to find the hour that has the most hits
  The day of the week that has the most hits
  and the max and ave  no of hits of these.

I haven't given it a whole lot of thought but I'd be tempted to dump the
whole thing into an appropriately structured sql database and then use
SELECT's to extract the information you want.  It'll likely end up
faster and less processor intensive than doing it in php by itself I
suspect.

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Newbie challenge to brainiacs

2002-05-14 Thread Jay Blanchard

[snip]
  I want to try to find the hour that has the most hits
  The day of the week that has the most hits
  and the max and ave  no of hits of these.

I haven't given it a whole lot of thought but I'd be tempted to dump the
whole thing into an appropriately structured sql database and then use
SELECT's to extract the information you want.  It'll likely end up
faster and less processor intensive than doing it in php by itself I
suspect.
[/snip]

+1

Not only that, but then you will have the ability to create queries for
other important factors in the logs without having to recode, or create
code.

Jay



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Newbie challenge to brainiacs

2002-05-14 Thread David Jackson

Jay Blanchard wrote:
 
The burning issue that begs to be answered is, why reinvent the wheel?
There is a least a dozen blogs on freshmeat for PHP along... 
Unless your doing it just for kicks, which is OK.

David


 [snip]
   I want to try to find the hour that has the most hits
   The day of the week that has the most hits
   and the max and ave  no of hits of these.
 
 I haven't given it a whole lot of thought but I'd be tempted to dump the
 whole thing into an appropriately structured sql database and then use
 SELECT's to extract the information you want.  It'll likely end up
 faster and less processor intensive than doing it in php by itself I
 suspect.
 [/snip]
 
 +1
 
 Not only that, but then you will have the ability to create queries for
 other important factors in the logs without having to recode, or create
 code.
 
 Jay

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php