Problem with log files

Discussion in 'Apache' started by PremiumSaltine, Jan 2, 2013.

  1. #1
    I'm currently using "SetEnvIf Request_URI "blahblah" dontlog" for simple requests, however I have more complex requests I'm having troubles filtering.

    GET /p/index.html?cmd=thumb&sfpg=MjAwNS8wOS8qMDAwXzA0NzYuanBnKjU3ZjMyMjc0NDg5YTdiMTVhM2RkNWE4NWI4ZWZjYWYw
    GET /p/index.html?cmd=photo&sfpg=MjAwNS8wOS8qMDAwXzA0NzYuanBnKjU3ZjMyMjc0NDg5YTdiMTVhM2RkNWE4NWI4ZWZjYWYw

    I would like to filter out just the requests with "cmd=thumb", but i can't quite figure out how to do it. Please help me out here. Thank you.
     
    PremiumSaltine, Jan 2, 2013 IP
  2. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    According to mod_setenvif documentation, Request_URI doesn't include the querystring.
    http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html

    The manual page mentions RewriteCond for matching the querystring, but that's not very helpful when it comes to logging I suppose. Even if you use mod_rewrite to set an environment variable that SetEnvIf can look at, Apache's still going to log that request, I think.

    Maybe experiment with rewriting to the requested URL, and setting an environment variable SetEnvIf can look for without doing an external redirect, see if Apache logs it.
     
    joebert, Jan 30, 2013 IP