Unsupported scripts and control panel web app for a hosting company
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

analyselog.php 344B

123456789101112131415161718192021
  1. #!/usr/bin/php -q
  2. <?PHP
  3. $log = 3;
  4. $log = str_pad($log, 3, '0', STR_PAD_LEFT);
  5. $fh = fopen('/usr/local/apache/logs/'.$log.'-access_log','r');
  6. while (!feof($fh)) {
  7. $line = trim(fgets($fh));
  8. if (preg_match('/^.*?"[A-Z]+ (.*?) [^ ]*?" .* ([0-9]+)$/',$line,$m)) {
  9. if ((int)$m[2] > 100000) {
  10. echo $m[1]."\r\n";
  11. }
  12. }
  13. }
  14. fclose($fh);
  15. ?>