You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Behlendorf <br...@organic.com> on 1996/11/04 00:58:33 UTC

Re: Putting the date into the referer log.

On Thu, 24 Oct 1996, Paul Sutton wrote:
> I agree about being careful here, but I think there is a case for adding a
> directive to set an env var based on artibrary headers, a generic form of
> BrowserMatch. The generic functionality will be useful with far more than
> just config logs.

I like this.  Generalization is almost always a good thing.  :)  
I could easily see

  HeaderMatch User-Agent /^Mozilla/ netscape=yes

or whatever instead of

  BrowserMatch /^Mozilla/ netscape=yes

The next question is, do we need access to other types of info, such as
remote_host?  Paul needs it for his host-based logging.  What else would really
be needed?  Request time?  

Anyways, if other folks think this at least the first option is a good idea, we
should move soon, before "BrowserMatch" becomes something we need to
backwards-support.

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS


Re: SetEnvIf/HeaderMatch (was Re: Putting the date into the referer log.)

Posted by Ed Korthof <ed...@organic.com>.
On Nov 4,  9:19am, Paul Sutton wrote:
> Subject: Re: Putting the date into the referer log.
>
> Ok, here is a first draft of my 'mod_setenvif'. I've called the directive
> SetEnvIf rather than HeaderMatch because it is capable of much more than
> just matching on headers (and it is functionally similar to a conditional
> SetEnv module, although it uses BrowserMatch syntax for setting env-vars,
> not SetEnv). So the example becomes
>
>   SetEnvIf User-Agent /^Mozilla/ netscape=yes
>
> There is a SetEnvIfNoCase to correspond with BrowserMatchNoCase. I'd
> prefer to make case-ness an argument, but passing more than three gets
> tricky. This module already needs an extra options argument, ITERATE3
> (patch also enclosed).

Hi y'all (my first post to this list) --

I have a request for this module, which I'd be willing to help code.  Is there
some way to extract part of the UA string?  I'd like to be able to get the
version number of the browser, and possibly other information.  (This could
certainly wait till after 1.2 so long as backward compatibility is easy to
maintain.)  Unless the function does more than is shown, it'd be hard to do
this without an unappealing, brute-force method.

Storing variables via ()'s (in $1, etc.) seems one possible way, but I don't
know how much work that is, since I've never implemented such a system.  I'm
going to go over the module and see about implementing this, but I wanted to
ask about it here before I spend too much time on it.

Also, why not specify case-ness in the match (with the default case-sensative)
via a letter appended to the closing '/' -- a la Perl's match operator?
 Compact, consistent with what users would likely expect, it avoids the need
for another argument, and it'd be easy to expand if needed.

In any case --

Ed Korthof
ed@organic.com

Re: Putting the date into the referer log.

Posted by Paul Sutton <pa...@ukweb.com>.
On Sun, 3 Nov 1996, Brian Behlendorf wrote:
> I like this.  Generalization is almost always a good thing.  :)  
> I could easily see
> 
>   HeaderMatch User-Agent /^Mozilla/ netscape=yes

Ok, here is a first draft of my 'mod_setenvif'. I've called the directive
SetEnvIf rather than HeaderMatch because it is capable of much more than
just matching on headers (and it is functionally similar to a conditional
SetEnv module, although it uses BrowserMatch syntax for setting env-vars,
not SetEnv). So the example becomes

  SetEnvIf User-Agent /^Mozilla/ netscape=yes

There is a SetEnvIfNoCase to correspond with BrowserMatchNoCase. I'd
prefer to make case-ness an argument, but passing more than three gets
tricky. This module already needs an extra options argument, ITERATE3
(patch also enclosed).

> The next question is, do we need access to other types of info, such as
> remote_host?  Paul needs it for his host-based logging.  What else would really
> be needed?  Request time?  

There are a few examples in the module: remote_host, remote_addr,
remote_user, request_uri and request_method. These are similar to the
envvars passed to CGI and SSI, or the names used in mod_rewrite. 

Paul
UK Web Ltd