Query strings, Python and Apahce Log file - cant get ad network query strings

dmontgom
dmontgom used Ask the Experts™
on
Hi,

I am using apache2 on linux with web.py and python2.5.

In my log file I see the following....
66.91.XX.XX - - [18/Jul/2009:16:25:56 -0500] "GET / HTTP/1.1" 200 3102 "http://exercise.about.com/od/abs/ss/abexercises_3.htm" "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-$
1

what env variable holds "http://exercise.about.com/od/abs/ss/abexercises_3.htm" "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X;?
 

On my web app...I try to get the query string using:
 env = web.ctx['environ']
QUERY_STRING = env['QUERY_STRING']
Appareanly its not query_string....so....what is it?


Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2008
Commented:
> what env variable holds "http://exercise.about.com/od/abs/ss/abexercises_3.htm" "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X;?

"GET / HTTP/1.1" 200 3102 "http://exercise.about.com/od/abs/ss/abexercises_3.htm"   >> THE_REQUEST

"Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-$   >> User_Agent

When you're seeing a full URL (instead of an URL-path like /foo/bar.py) in your request string, s/o uses your server as a forward-proxy.

> so....what is it

REQUEST_URI should contain the value.

Author

Commented:
Thanks

Commented:
Actually, this part ....

"http://exercise.about.com/od/abs/ss/abexercises_3.htm"

... looks like a referrer to me -- which, IIRC, is in the HTTP_REFERER env var.

And likewise, it would be HTTP_USER_AGENT, since these are client supplied headers and dependent on the browser to pass them.

See also,
  http://webpy.org/cookbook/ctx
  http://www.python.org/dev/peps/pep-0333/#environ-variables

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial