>прикольная идея, подумаю, может добавть ;-))
лишь бы потом на тебя в суд не подали :\пример работы :
cat access.log | ./sq_aa >> qu.txt
получаются строки вида
Sun Apr 17 13:35:18 2005 192.0.0.115 yandex 'ЗЗаппросс'
файл qu.txt смотреть браузером, так как запросы в разных кодировках (кои\вин\утф)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/perl
while (<STDIN>)
{
$type='';
if (/GET http\:\/\/www\.yandex\.ru\/yandsearch\?/) {$type='yandex'}
elsif (/GET http\:\/\/search\.rambler\.ru\/srch\?/) {$type='rambler'}
elsif (/GET http\:\/\/search.tut.by\/\?/) {$type='tut'}
elsif (/GET http\:\/\/www\.google\..*\/search\?/) {$type='google'}
elsif (/GET http\:\/\/an\.aport\.ru\/scripts\/template\.dll\?/) {$type='aport'}
else {next}
s!\s+! !g;
@a=split/ /;
foreach $i ((split '&',$a[6]))
{
if (
(($type eq 'yandex')&&($i=~/^text=(.*)$/))||
(($type eq 'aport')&&($i=~/^r=(.*)$/))||
(($type eq 'rambler')&&($i=~/^q=(.*)$/))||
(($type eq 'rambler')&&($i=~/^words=(.*)$/))||
(($type eq 'rambler')&&($i=~/^old_q=(.*)$/))||
(($type eq 'tut')&&($i=~/^query=(.*)$/))||
(($type eq 'google')&&($i=~/^q=(.*)$/))
)
{
$q=$1;
$q=~s/\+/ /g;
$q=~s/%([0-9A-Ha-h]{2})/pack('C',hex($1))/ge;
print localtime($a[0])." $a[2] $type \'$q\'\n";
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~