Forum Moderators: phranque

Message Too Old, No Replies

Log: hostname instead of ips

         

enotalone

1:55 am on Jun 5, 2006 (gmt 0)

10+ Year Member



For some reason my log started to log hostnames instead of most ips. Just noticed this today and not sure how long it has been doing it but a month ago or so last time i took a look into raw logs without urchin it was fine.

Anwy i have my format as

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

HostnameLookups is set to Off

Interesting but while most entries are logged as hostname some are normal just ips.

Thank you.

jdMorgan

3:21 pm on Jun 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In this case, it looks like your log_config string is requesting this behaviour by specifying "%u" instead of "%a". In some cases, the reverse-DNS lookup function may time out or be unavailable, so the server reverts to logging the IP address (which is directly accessible in the request itself, and does not need to be looked up by sending a query to the DNS system).

The log format 'decoding key' is given in the Apache mod_log_config documentation [httpd.apache.org].

Jim

coopster

3:24 pm on Jun 5, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Looks like the default
combined
LogFormat [httpd.apache.org] with the Remote host (%h) specified. If you want IP you will have to change your format [httpd.apache.org].

coopster

3:32 pm on Jun 5, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



"%u"
, jd, or did you mean
"%h"
?

jdMorgan

3:48 pm on Jun 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, sorry. %u is the remote user and %h is remote hostname.

Jim

enotalone

5:09 pm on Jun 5, 2006 (gmt 0)

10+ Year Member



Thank you everyone, so it should be?

LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

enotalone

5:50 pm on Jun 5, 2006 (gmt 0)

10+ Year Member



Thank you everyone, much appreciated

I tried "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined and it seems to do the trick!