]>
git.ipfire.org Git - thirdparty/squid.git/blob - contrib/user-agents.pl
3 # * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
5 # * Squid software is distributed under GPLv2+ license and includes
6 # * contributions from numerous individuals and organizations.
7 # * Please see the COPYING and CONTRIBUTORS files for details.
17 open (ACCESS
, "/opt/Squid/logs/useragent.0");
20 ($host, $timestamp, $agent) =
21 /^(\S+) \[(.+)\] \"(.+)\"\s/;
28 next unless $seen{$agent}++;
30 @inline=split(/ /, $agent);
31 next unless $seen{$inline[0]}++;
37 if (!$opt_L) {$opt_L=0}
39 print "Summary of User-Agent Strings\n(greater than $opt_L percent)\n\n";
41 foreach $browser (keys(%seen)) {
42 $total=$total+$seen{$browser};
45 foreach $browser (sort keys(%seen)) {
46 $percent=$seen{$browser}/$total*100;
47 if ($percent >= $opt_L) { write; }
50 print "\n\nTotal entries in log = $total\n";
53 @
>>>>>>> :@
##.####% : @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
54 $seen{$browser}, $percent, $browser