I can think of two ways to use the information. One would be to put
the country code into an existing unused field (like the username
field) and then use the User Report to get a break down by GeoIP-based
country. Alternately, you could use the extra field as you have and
write a log file format that assigns the value to %v and use the
Virtual Host report to see the countries. You could modify the (analog
or rmagic) language files if you want that report have a different
name or description.

The other solution would be to have your reformat program write the
two-letter country code into the IP number field:

    162.33.158.81 --> 162.33.158.81.us

Then the Domain Report will show the break down by Geo-IP-based
countries rather than hostname TLDs.

-- 

Jeremy Wadsack
Wadsack-Allen Digital Group


Bobby Hitt ([EMAIL PROTECTED]; Wednesday, May 28, 2003 11:36 AM):

> Hello all,

> I wrote a small 'C' application that takes the standard apache log files,
> looks up the IP address using the geoip-lookup function:

> 162.33.158.81 - - [12/May/2003:20:25:31 -0400] "GET /images/top.gif
> HTTP/1.1" 200 1412 "http://www.washingtongolf.com/Taylor_Made.htm";
> "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

> and writes out as:

> 162.33.158.81 "United States" - - [12/May/2003:20:25:31 -0400] "GET
> /images/top.gif HTTP/1.1" 200 1412
> "http://www.washingtongolf.com/Taylor_Made.htm"; "Mozilla/4.0 (compatible;
> MSIE 6.0; Windows NT 5.0)

> geoip-lookup is part of the MaxMind geoip country PurePerl API that is
> available here:

> http://www.maxmind.com/download/geoip/api/perl/

> The PurePerl version doesn't require the GEOIP 'C' library. Now if someone
> can figure out how to tell analog and rmagic to do something with this
> format, please let me know :^)

> Email me if you want the 'C' app, just compile with "gcc -o reformat
> reformat.c". Execute as "reformat file-in file-out". file-in is your regular
> apache log file, with unresolved IP addresses. file-out adds the country, if
> found, "-" otherwise. A temp file, "country.txt" is created in the current
> directory to hold the output of geoip-lookup. I use the -l option to get the
> long country name, leave off if you just want the 2 letter code.

> HTH,

> Bobby

> ----- Original Message ----- 
> From: "Bobby Hitt" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, May 28, 2003 11:12 AM
> Subject: Re: [analog-help] IP-to-country


>> Hello,
>>
>> Some more information. The country database is available for free from
>> www.MaxMind.com, along with the API's for several different languages,
>> including Perl, 'C', PHP and Ruby. As to how to incorporate this into
>> analog, haven't a clue. But the tools and database are available.
>>
>> HTH,
>>
>> Bobby
>>
>> ----- Original Message ----- 
>> From: "Jeremy Wadsack" <[EMAIL PROTECTED]>
>> To: <[EMAIL PROTECTED]>
>> Sent: Tuesday, May 27, 2003 11:14 AM
>> Subject: Re: [analog-help] IP-to-country
>>
>>
>> >
>> > Alexander Chirkov ([EMAIL PROTECTED]; Tuesday, May 27, 2003 5:26 AM):
>> >
>> > > It would be great if I can use this DB in analog!
>> > > http://ip-to-country.com/database/
>> >
>> >
>> > There was significant discussion of geotargeting on the list
>> > previously:
>> >
>> >   http://www.mail-archive.com/[EMAIL PROTECTED]/msg13905.html
>> >   http://www.mail-archive.com/[EMAIL PROTECTED]/msg14373.html
>> >
>> > But (as mentioned in the second message above), little consensus as to
>> > which service to implement, and they do not provide a common
>> > interface. The only way to do this currently would involve (a) hacking
>> > the code to generate a report for your specific GeoIP database, or (b)
>> > hijacking the Domain Report by changing the DNS lookups to match the
>> > GeoIP values. There is even a DNS server you can use to do this fairly
>> > simply.

+------------------------------------------------------------------------
|  TO UNSUBSCRIBE from this list:
|    http://lists.isite.net/listgate/analog-help/unsubscribe.html
|
|  Digest version: http://lists.isite.net/listgate/analog-help-digest/
|  Usenet version: news://news.gmane.org/gmane.comp.web.analog.general
|  List archives:  http://www.analog.cx/docs/mailing.html#listarchives
+------------------------------------------------------------------------

Reply via email to