glenn       2003/07/03 07:41:12

  Modified:    jk/tools/reports tomcat_trend.pl
  Log:
  Prevent script from failing on bad date format
  
  Revision  Changes    Path
  1.5       +7 -3      jakarta-tomcat-connectors/jk/tools/reports/tomcat_trend.pl
  
  Index: tomcat_trend.pl
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/tools/reports/tomcat_trend.pl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- tomcat_trend.pl   14 Mar 2003 13:36:58 -0000      1.4
  +++ tomcat_trend.pl   3 Jul 2003 14:41:12 -0000       1.5
  @@ -179,6 +179,10 @@
         ($mon, $day, $time, $year) = (split /\s+/,$line)[1..4];
         ($hour, $min, $sec) = split /:/,$time;
         $year =~ s/\]$//;
  +      if( $day !~ /^\d+/ || $hour !~ /^\d+/ || $min!~ /^\d+/ || $sec !~ /^\d+/ ) {
  +         print "Unknown log entry: $origline\n" unless $origline =~ /\.c /;
  +         next;
  +      }
         # print "$mon $day $time $year $hour $min $sec\n";
         $logtime = timelocal($sec,$min,$hour,$day,$MON{$mon},$year-1900);
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to