Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/09/2008, 13:39
juanfuentes
 
Fecha de Ingreso: mayo-2005
Mensajes: 188
Antigüedad: 19 años
Puntos: 6
Respuesta: Expresión regular para access.log de Apache

Pues ahí va el primer cambio:

Regexp:
Código:
'/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) (\S+) (\S+) \[(.*)\] "(.*) (.*) HTTP\/(.*)" (\d+) (\d+|-) "(.*)" "(.*)"/'
Campos:
Código PHP:
$log['ip'] = $match[1];
$log['rlogname'] = $match[2];
$log['user'] = $match[3];
$log['datestr'] = $match[4];
$log['option'] = $match[5];
$log['url'] = $match[6];
$log['http'] = $match[7];
$log['code'] = $match[8];
$log['bytes'] = $match[9];
$log['ref'] = $match[10];
$log['agent'] = $match[11];