I also use squid_db_auth for authentication, kindly use
sub ip_check_client()
{
my %hostname;
while (<>) {
my $line = $_;
my($host, $rest) = split / /, $line, 2;
if ($host =~ /^\d+\.\d+\.\d+\.\d+$/) {
unless (exists $hostname{$host}) {
$hostname{$host} = gethostbyaddr(inet_aton($host), AF_INET);
}
if ($hostname{$host}) {
$line = "$hostname{$host} $rest";
}
}
return $line;
}
}
kindly use for only ip capture