Files
zira-etc/multitail/convert-geoip.pl
2021-05-24 22:18:33 +03:00

22 lines
223 B
Perl

#!/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";
}