I'm trying to write a script that extracts some search-queries from a
logfile, but I'm having problems finding the right function to solve this
problem.

Below you'll find 4 lines from the log - the words I'm trying to extract are
(for now) written in capital letters, and they are always found between the
expression "query=" and "&hits=".

Straightforward; I am trying to get everything between "query=" and "&hits="
on each line, and output statistics on different search queries on a web
page. Probably an easy thing to do, but I'm kinda stuck on this one...

*****

192.168.0.1 - - [20/Dec/2002:12:19:24 +0100] "GET
/cgi-bin/search?query=WORD&hits=10&offset=0&clustering=yes&type=all&version=
3.1.0 HTTP/1.1" 200 917 ""0.0310 0.0000 0.0000 0

192.168.0.1 - - [20/Dec/2002:12:19:25 +0100] "GET
/cgi-bin/search?query=ANOTHERWORD&hits=10&offset=0&clustering=yes&type=all&v
ersion=3.1.0 HTTP/1.1" 200 917 ""0.0150 0.0000 0.0000 0

192.168.0.1 - - [20/Dec/2002:12:19:27 +0100] "GET
/cgi-bin/search?query=YETANOTHERWORD&hits=10&offset=0&clustering=yes&type=al
l&version=3.1.0 HTTP/1.1" 200 917 ""0.0310 0.0000 0.0000 0

192.168.0.1 - - [20/Dec/2002:12:19:53 +0100] "GET
/cgi-bin/search?query=AGAINWITHTHEWORD&hits=10&offset=0&qtf_lemmatize=true&r
pf_clustering:enabled=1&rpf_clustering:root=%2A&clustering=yes&type=all&vers
ion=3.1.0 HTTP/1.1" 200 980 ""0.0310 0.0000 0.0000 0

*****

TIA

[EMAIL PROTECTED]



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

Reply via email to