www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Michaelson <...@dstc.edu.au>
Subject mod_log-any/2276: mod_log_config can't log IP address unless DNS is disabled or failed.
Date Mon, 25 May 1998 00:14:07 GMT

>Number:         2276
>Category:       mod_log-any
>Synopsis:       mod_log_config can't log IP address unless DNS is disabled or failed.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Sun May 24 17:20:00 PDT 1998
>Originator:     ggm@dstc.edu.au
>Release:        1.2.6 et seq
Any. (new feature)	
DNS address is interesting but not 'canonical' enough for flow based
charging and reconciliation. 10% + of hosts don't have DNS names, and
of those that do, a significant number can't be reverse-looked up to their
IP address within 1 week of being used (dynamic pools etc)

I have therefore modified mod_log_config.c to include a new  %I directive
to log the IP address, which is held in the r_>connection block anyway.

The code is very simple.


Here is the code:  add to log_item_keys

    { 'I', log_remote_addr, 0 },

and add to the function lists
char *log_remote_addr (request_rec *r, char *a)
   char dummy[16];

   return pstrdup(r->pool, inet_ntoa(r->connection->remote_addr.sin_addr));

It just works! I'm using this with a modified filter on analog to parse
common logformat files, and sort/grade using IP address while still being
able to count DNS name
[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]

View raw message