I am not getting this solution guys. I appreciate the help, but had a hard time understanding Rolfs code and played with it for a while with little success. With that being said, my temp solution, I understand is the way I would like to follow.
while ( defined( $_ = <$Rlog> )) {
s/^Alert Level\s0*(?:[3-9]|\d{2,})/DEREK_SMITH\n$&/s;
}
continue {
print $_;
}
###-- this works, but only half way.
__OUT__
==========================================
Log Entry 13: 20 Feb 2011 08:33:42
Alert Level 2: Informational
Keyword: Type-02 127002 1208322
Soft Reset
Logged by: Baseboard Management Controller;
Sensor: System Event
0x204D60D1E60200E0 FFFF027000120300
==========================================
Log Entry 12: 20 Feb 2011 07:14:27
DEREK_SMITH
Alert Level 4: TEST ALERT!!!!!!!!!!!!!!!!
Keyword: Type-02 127002 1208322
Soft Reset
Logged by: Baseboard Management Controller;
Sensor: System Event
0x204D60BF530200D0 FFFF027000120300
==========================================
Log Entry 11: 13 Feb 2011 07:24:32
DEREK_SMITH
Alert Level 5: TEST ALERT!!!!!!!!!!!!!!!!!!!!
Keyword: Type-02 127002 1208322
Soft Reset
Logged by: Baseboard Management Controller;
Sensor: System Event
0x204D5787300200C0 FFFF027000120300
__DATA__NEEDED__
==========================================
Log Entry 13: 20 Feb 2011 08:33:42
Alert Level 2: Informational
Keyword: Type-02 127002 1208322
Soft Reset
Logged by: Baseboard Management Controller;
Sensor: System Event
0x204D60D1E60200E0 FFFF027000120300
==========================================
Log Entry 12: 20 Feb 2011 07:14:27
DEREK
Alert Level 4: TEST ALERT!!!!!!!!!!!!!!!!
SMITH
Keyword: Type-02 127002 1208322
Soft Reset
Logged by: Baseboard Management Controller;
Sensor: System Event
0x204D60BF530200D0 FFFF027000120300
==========================================
Log Entry 11: 13 Feb 2011 07:24:32
DEREK_
Alert Level 5: TEST ALERT!!!!!!!!!!!!!!!!!!!!
Keyword: Type-02 127002 1208322
SMITH
Soft Reset
Logged by: Baseboard Management Controller;
Sensor: System Event
0x204D5787300200C0 FFFF027000120300
either SMITH after 'Keyword' or after 'Alert' either one is fine.