1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| line: while ( <INCLUDE1_FILE> ) {
chop;
@Fld = split( ' ', $_, 9999 );
# lines we can ignore ???
#if ( scalar( @Fld ) < 4 ) { # ignore these
#next line;
#}
# extract time from input line
$timestamp = $Fld[1];
# keep track of the last time found
$timestampN = $timestamp;
# convert time to seconds
#
$inout = $Fld[3];
$s = ':', $inout =~ s/$s//g;
# first timestamp found in the log file ???
if ($datestamp eq '??-???-????') {
# initial timestamp found
# re-format into an unambigous date format
$s = "\\(", $Fld[$#Fld] =~ s/$s//g;
$s = "\\)", $Fld[$#Fld] =~ s/$s//g;
@date = split(/\//, $Fld[$#Fld], 9999);
$M = $date[1]++;
$datestamp = $date[2] . '-';
$datestamp = $datestamp . $month[$M];
$datestamp = $datestamp . '-';
$datestamp = $datestamp . $date[3];
#datestamp = date[2] "-" month[m] "-" date[3] ;
# initialise the first/last date/timestamps found
$datestamp1 = $datestamp;
$datestampN = $datestamp;
$timestamp1 = $timestamp;
#
$date[1]-- ;
#Debug
#print $date[2], $date[1], $date[3] ;
$dayOfTheWeek = Date_DayOfWeek( $date[1], $date[2], $date[3],);
$dayStamp = $day[ $dayOfTheWeek];
#print "Daystamp 262 : $dayStamp";
# skip processing this line further
next line;
}
# any normal timestamp ???
if ($inout eq 'TIMESTAMP') {
# re-format into an unambigous date format
@date = split(/\//, $Fld[4], 9999);
$M = $date[1]++;
#
$datestamp = $date[2] . '-';
$datestamp = $datestamp . $month[$M];
$datestamp = $datestamp . '-';
$datestamp = $datestamp . $date[3];
# set the last datestamps found
$datestampN = $datestamp;
#
# first time/date stamp not yet set?
if ($datestamp1 eq '??-???-????') {
$datestamp1 = $datestamp;
}
if ($timestamp1 eq '??:??:??') {
$timestamp1 = $timestamp;
}
#
# get the day of the week
$date[1]-- ;
$dayOfTheWeek = Date_DayOfWeek( $date[1], $date[2], $date[3]);
$dayStamp = $day[ $dayOfTheWeek] ;
# skip processing this line further
next line;
} |
Partager