I have a set of logs that looks like this (below). For each line the first seven chunks are the same. I would like to put the file into an array and then split the data first by spaced until I reach chunk 8, which is of a variable length. I would like everything past /vol/vol0/(5) or equivalent to be a single chunk.
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg(Percentof phase4 time spent for: reading inos 0% dumpinginos 96%)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Percentof phase4 dump time spent for: wafl read iovec: 54% lev0-ra 0%)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Phase 4 averages (usec): wafl read iovec time 1902 lev el 0 ra time 219)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Tape write times (msec): average: 0 max: 1200)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Tape changes: 1)
dmp Sun Nov 29 10:57:40 IST /vol/INMTACFL00_vol1/(5) Start (Level 0, NDMP)
dmp Sun Nov 29 10:57:40 IST /vol/INMTACFL00_vol1/(5) Options (b=63, u, X)
dmp Sun Nov 29 10:57:40 IST /vol/INMTACFL00_vol1/(5) Snapshot (INBLHCFL07(0101178115)_INMTACFL00_vol1.167 8, Sun Nov 29 10:00:11 IST)
dmp Sun Nov 29 10:57:44 IST /vol/INMTACFL00_vol1/(5) Tape_open (ndmp)
dmp Sun Nov 29 10:57:44 IST /vol/INMTACFL00_vol1/(5) Phase_change (I)
dmp Sun Nov 29 11:03:58 IST /vol/INMTACFL00_vol5/(0) Tape_close (ndmp)
Here I split the file by space, but I don't know how to update teh split function for what I need.
--- You must not fight too often with one enemy, or you will teach him all your tricks of war.
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg(Percentof phase4 time spent for: reading inos 0% dumpinginos 96%)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Percentof phase4 dump time spent for: wafl read iovec: 54% lev0-ra 0%)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Phase 4 averages (usec): wafl read iovec time 1902 lev el 0 ra time 219)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Tape write times (msec): average: 0 max: 1200)
dmp Sun Nov 29 10:56:58 IST /vol/vol0/(5) Log_msg (Tape changes: 1)
dmp Sun Nov 29 10:57:40 IST /vol/INMTACFL00_vol1/(5) Start (Level 0, NDMP)
dmp Sun Nov 29 10:57:40 IST /vol/INMTACFL00_vol1/(5) Options (b=63, u, X)
dmp Sun Nov 29 10:57:40 IST /vol/INMTACFL00_vol1/(5) Snapshot (INBLHCFL07(0101178115)_INMTACFL00_vol1.167 8, Sun Nov 29 10:00:11 IST)
dmp Sun Nov 29 10:57:44 IST /vol/INMTACFL00_vol1/(5) Tape_open (ndmp)
dmp Sun Nov 29 10:57:44 IST /vol/INMTACFL00_vol1/(5) Phase_change (I)
dmp Sun Nov 29 11:03:58 IST /vol/INMTACFL00_vol5/(0) Tape_close (ndmp)
Here I split the file by space, but I don't know how to update teh split function for what I need.
Code:
while (<BACKUPLOG>) {
chomp;
my($type,$day,$month,$date,$time,$zone,$volume,$else)=split/ /;
%bkhash =
print "$volume,$else\n";
}
close (BACKUPLOG);
--- You must not fight too often with one enemy, or you will teach him all your tricks of war.