Initial commit.
This commit is contained in:
21
multitail/convert-geoip.pl
Normal file
21
multitail/convert-geoip.pl
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Geo::IP;
|
||||
|
||||
my $gi = Geo::IP->new(GEOIP_STANDARD);
|
||||
|
||||
$| = 1;
|
||||
|
||||
while(<>)
|
||||
{
|
||||
chomp($_);
|
||||
|
||||
$country = $gi->country_code_by_addr($_);
|
||||
|
||||
if ($country eq '')
|
||||
{
|
||||
$country = '?';
|
||||
}
|
||||
|
||||
print "$_ ($country)\n";
|
||||
}
|
||||
Reference in New Issue
Block a user