|
\n");
foreach( $logs as $line )
{
$pattern = '/(\d{4}[-]\d{2}[-]\d{2}) (\d{2}:\d{2}:\d{2}) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
(.*) (.*) (.*) (\d+) (.*) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) (.*) (.*)/U';
#$pattern = '/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) (.*) (.*) (\[.*\]) (".*") (\d\d\d) (.*)
(".*") (".*")/U';
preg_match( $pattern, $line, $entries );
list( $complete_match,
$log['date'],
$log['time'],
$log['s_ip'],
$log['method'],
$log['uri_stem'],
$log['uri_query'],
$log['port'],
$log['user'],
$log['c_ip'],
$log['ua']
) = $entries;
# do something here with the data
print("{$log['date']} | {$log['time']} | {$log['s_ip']} | {$log['method']} | {$log['uri_stem']}
| {$log['uri_query']} | {$log['port']} | ");
print("{$log['user']} | {$log['c_ip']} | {$log['ua']} | ");
print(" \n");
}
?>
# do something here with the data
print("{$log['date']} | {$log['time']} | {$log['s_ip']} | {$log['method']} | {$log['uri_stem']}
| {$log['uri_query']} | {$log['port']} | ");
print("{$log['user']} | {$log['c_ip']} | {$log['ua']} | ");
print(" \n");
}
?>
|
|