Raised This Month: $51 Target: $400
 12% 

[SRCDS]CountryAnalyzer, now also with Cities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 05-06-2009 , 07:21   [SRCDS]CountryAnalyzer, now also with Cities
Reply With Quote #1

Hi everybody!

Some people at our forums wanted to know where do the people come from who connect to our server, so I wrote a command line application to parse the log files and create a statistic.
If you want to use it you need the GeoIP.dat from maxmind (http://geolite.maxmind.com/download/...eoLiteCountry/) and .NET 2.0

Start it like this:
CountryAnalyzer.exe PATH_TO_GEOIP PATH_TO_LOGS
e.g.
Code:
CountryAnalyzer.exe ./GeoIP.dat ./logs
It will parse through all the log files (*.log) and print a statistic like this:
Quote:
Total connections: 4394
[Germany, 2718]
[United Kingdom, 333]
[United States, 148]
[Russian Federation, 140]
[Sweden, 135]
[France, 128]
[Finland, 91]
[Italy, 80]
[Netherlands, 69]
[Norway, 69]
[Austria, 63]
[Denmark, 49]
[Switzerland, 36]
[Spain, 34]
[Canada, 34]
[Poland, 33]
[Czech Republic, 31]
[Hungary, 28]
[Belgium, 20]
[Slovakia, 15]
[Ukraine, 15]
[Ireland, 12]
[Israel, 12]
[Bulgaria, 10]
[Slovenia, 10]
[Lithuania, 9]
[Brazil, 7]
[Greece, 7]
[Portugal, 7]
[Estonia, 7]
[Mexico, 5]
[Croatia, 5]
[Latvia, 4]
[Romania, 4]
[Saudi Arabia, 4]
[Iceland, 3]
[Turkey, 3]
[Serbia, 3]
[United Arab Emirates, 2]
[Belarus, 2]
[Gibraltar, 2]
[Luxembourg, 2]
[Thailand, 1]
[Singapore, 1]
[Australia, 1]
[Aland Islands, 1]
[Qatar, 1]
I only tested it with TF2 logs! If you try it with anything else and run into an error let me know and send me the log file :-)
Attached Files
File Type: zip CountryAnalyzer.zip (13.3 KB, 177 views)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de

Last edited by Sillium; 05-26-2009 at 05:00.
Sillium is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 05-06-2009 , 08:23   Re: [SRCDS]CountryAnalyzer
Reply With Quote #2

Here is another version. Now it is possible to count every IP only once.

Start like this:
Code:
CountryAnalyzer.exe ./GeoIP.dat ./logs false
false = every IP is only counted once
true = don't care about IPs
Attached Files
File Type: zip CountryAnalyzer.zip (13.4 KB, 141 views)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de

Last edited by Sillium; 05-06-2009 at 08:36.
Sillium is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 05-06-2009 , 08:51   Re: [SRCDS]CountryAnalyzer
Reply With Quote #3

Very neat. It could be used to make some interesting statistists.

Also, this post should probably go under snippets, tutorials, extensions. I'd hate to see this post get bumped by most of the garbage in General.
__________________

Last edited by pheadxdll; 05-06-2009 at 08:54.
pheadxdll is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 05-06-2009 , 11:21   Re: [SRCDS]CountryAnalyzer
Reply With Quote #4

Yeah you're probably right.

If an Admin sees this please move it :-) Thx!!
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 05-08-2009 , 05:20   Re: [SRCDS]CountryAnalyzer
Reply With Quote #5

And another Version:

This time we only count every SteamID once and every IP once. So if a SteamID is already known we won't count it anymore and move on. If different SteamIDs used the same IP we count the IP only once.

Usage:
Code:
CountryAnalyzer.exe ./GeoIP.dat ./logs
Note that the true/false parameter is gone.

Example output
Quote:
Total connections: 4394
Total counted IPs: 1815
Total counted SteamIDs: 1864

[Germany, 609]
[United Kingdom, 198]
[United States, 120]
[Russian Federation, 104]
[France, 103]
[Sweden, 99]
[Finland, 63]
[Italy, 55]
[Norway, 52]
[Netherlands, 51]
[Denmark, 43]
[Canada, 29]
[Austria, 29]
[Spain, 27]
[Poland, 26]
[Czech Republic, 24]
[Switzerland, 21]
[Hungary, 21]
[Belgium, 19]
[Israel, 12]
[Slovakia, 11]
[Ukraine, 11]
[Bulgaria, 10]
[Ireland, 9]
[Slovenia, 7]
[Brazil, 6]
[Lithuania, 6]
[Estonia, 6]
[Croatia, 5]
[Portugal, 5]
[Greece, 4]
[Romania, 4]
[Turkey, 3]
[Latvia, 3]
[Mexico, 3]
[Belarus, 2]
[United Arab Emirates, 2]
[Luxembourg, 2]
[Iceland, 2]
[Serbia, 2]
[Qatar, 1]
[Gibraltar, 1]
[Singapore, 1]
[Thailand, 1]
[Saudi Arabia, 1]
[Aland Islands, 1]
[Australia, 1]
Attached Files
File Type: zip CountryAnalyzer.zip (13.5 KB, 137 views)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de

Last edited by Sillium; 05-26-2009 at 05:00.
Sillium is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 05-20-2009 , 02:56   Re: [SRCDS]CountryAnalyzer
Reply With Quote #6

Just to let everyone know: It works with L4D-Logs too.

If anyone could supply me with an CSS/DODS Log I'll try that too :-)

And could some one please move the Thread to snipplets, extensions and co.!?
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 05-26-2009 , 04:51   Re: [SRCDS]CountryAnalyzer
Reply With Quote #7

The new Version also prints out the Cities.

You need another Geo-DB:
http://geolite.maxmind.com/download/...iteCity.dat.gz

Since the Output will be quite a little longer I recommend you send the output to a file like this:
Code:
CountryAnalyzer.exe .\GeoLiteCity.dat .\logs > analysed.txt
Attached Files
File Type: rar CountryAnalyzer.rar (54.8 KB, 142 views)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de

Last edited by Sillium; 05-26-2009 at 05:01.
Sillium is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 11-25-2009 , 04:05   Re: [SRCDS]CountryAnalyzer, now also with Cities
Reply With Quote #8

Just to let you know: Works with L4D2 too ;-)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 06-14-2010 , 04:52   Re: [SRCDS]CountryAnalyzer, now also with Cities
Reply With Quote #9

Found 2 Null-Pointers
Attached Files
File Type: zip CountryAnalyzer.zip (69.1 KB, 96 views)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 06-14-2010 , 09:48   Re: [SRCDS]CountryAnalyzer, now also with Cities
Reply With Quote #10

Damn... IP counting was incorrect all the time :-/
Attached Files
File Type: zip CountryAnalyzer.zip (69.1 KB, 105 views)
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode