]> git.openstreetmap.org Git - dns.git/commitdiff
Update tile log analyser to use chef gathered logs
authorTom Hughes <tom@compton.nu>
Sat, 31 Jan 2015 17:29:41 +0000 (17:29 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 31 Jan 2015 17:29:41 +0000 (17:29 +0000)
bin/sumlogs

index e342adc22ba4aede43b1fb3131428830b1923c00..7096bded346239d7d7bc9486490408783637ded6 100755 (executable)
@@ -13,7 +13,7 @@ my %country_bytes;
 
 while (my $record = <>)
 {
-    if ($record =~ /^\d+\.\d+\s+\d+\s+(\d+\.\d+\.\d+\.\d+)\s+TCP_[A-Z_]+\/\d+\s+(\d+) (?:GET|HEAD|POST|OPTIONS|PROPFIND) /)
+    if ($record =~ /^\d+\.\d+\s+\S+\s+".*"\s+(\d+\.\d+\.\d+\.\d+)\s+".*"\s+(\d+)$/)
     {
         my $ip = $1;
         my $bytes = $2;
@@ -28,14 +28,6 @@ while (my $record = <>)
 
         $total_bytes += $bytes;
     }
-    elsif ($record =~ /^\d+\.\d+\s+\d+\s+(\d+\.\d+\.\d+\.\d+)\s+TCP_DENIED\/\d+\s+(\d+) /)
-    {
-       # do nothing
-    }
-    elsif ($record =~ /^\d+\.\d+\s+\d+\s+(\d+\.\d+\.\d+\.\d+)\s+UDP_[A-Z_]+\/\d+\s+(\d+) ICP_QUERY /)
-    {
-       # do nothing
-    }
     else
     {
         warn $record;