Index: /trunk/arclog/arclog.pl
===================================================================
--- /trunk/arclog/arclog.pl	(revision 17271)
+++ /trunk/arclog/arclog.pl	(revision 17272)
@@ -18,4 +18,6 @@
 # accept no options
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+
+my $filter_records = 1;
 
 my $rcfile = "$ENV{HOME}/.arclogrc";
@@ -98,5 +100,9 @@
 # since the order in the sqllite db isn't guarenteed and we can't sort in the
 # db, we have to do this by hand
-my $last_recorded_time;
+#
+# futher, since it doesn't take 0 time to poll the cards -- and as it testing
+# it was determined that some cards weren't properly synced to an NTP server.
+# We should figure out the last record time for each host.
+my %latest_times;
 {
     my $strptime = DateTime::Format::Strptime->new(
@@ -117,16 +123,10 @@
         my $dt = $strptime->parse_datetime($time);
 
-        if (! defined $last_recorded_time) {
-            $last_recorded_time = $dt;
-        } elsif ($dt > $last_recorded_time) {
-            $last_recorded_time = $dt;
+        if (not exists $latest_times{$host}) {
+            $latest_times{$host} = $dt;
+        } elsif ($dt > $latest_times{$host}) {
+            $latest_times{$host} = $dt;
         }
 
-    }
-
-#    warn "latest timestamp is: $last_recorded_time\n";
-
-    unless (defined $last_recorded_time) {
-        warn "failed to determine the time of the last recorded record\n";
     }
 }
@@ -150,13 +150,16 @@
     my ($host, $time, $device, $event, $elapse_time, $errors)
         = @$rec{qw( host time device event elapse_time errors )};
+    # pack record
     $query->execute("$host|$time|$device|$event|$elapse_time|$errors")
         or die "database error: $!";
 
     # do not print filtered records
-    foreach my $filter (@myfilters) {
-        next RECORDS if $event =~ /$filter/;
+    if (defined $filter_records) {
+        foreach my $filter (@myfilters) {
+            next RECORDS if $event =~ /$filter/;
+        }
     }
     
-    if ($time > $last_recorded_time) {
+    if ($time > $latest_times{$host}) {
         print "$host $time $device $event $elapse_time $errors\n";
     }
