$totalsentrycalls=0; keys %count_by_sentry_server = 10; keys %count_by_ip = 10000; keys %count_by_api = 500; keys %count_by_api_exec = 500; while (sysread(INFILE, $buffer,16384,length $buffer)) { while ($buffer =~ m/(.+?)\|(.*)\n/g) { $totalsentrycalls++; $count_by_sentry_server{$0}++; $count_by_ip{$9}++; $count_by_api{$3}++; $count_by_api_exec{$3}{$totalsentrycalls}=$4; if ($31 =~ /^[A-Z]+/) { $hosts{$17}{$31}{$18}++; } else { if ($18 =~ /^[A-Z]+/) { $hosts{$17}{AORDIRECT}{$18}++; } else { $hosts{$17}{DB2}{LOCAL}++; } } } $buffer=substr($buffer, rindex($buffer, "\n")); print "$totalsentrycalls\n"; }