Hi everyone. I need some help on how to fix this.
I am getting positive result using the log file below and this command
awk -v t="06:10:22.211" -F'|' -v main=" RBL: " -v trig="BIOS-INFO" '$2 ~ t && $7 ~ main { first = $0; getline; } first && $7 ~ trig { printf "%s\n", first; exit }' log
|06:10:22.211| mymachine |2| | kernel :| RBL: RBL Code 10
|06:10:22.211| mymachine |1| | kernel :| DRPD: DRPD 789123
|06:10:22.211| mymachine |2| | kernel :| RTR: RTR Incomplete
|06:10:22.211| mymachine |2| | kernel :|RunThread() - This is it BIOS-INFOXXX : Alert, get info on the upper part.
but with this log im getting negative results.
|06:10:22.201| mymachine |2| | kernel :| RBL: RBL Code 10
|06:10:22.201| mymachine |1| | kernel :| DRPD: DRPD 789123
|06:10:22.201| mymachine |2| | kernel :| RTR: RTR Incomplete
|06:10:22.211| mymachine |2| | kernel :|RunThread() - This is it BIOS-INFOXXX : Alert, get info on the upper part.
How can i fix the script to match the timestamp "06:10:22.211" first then get the trigger value even though the timestamp different?
thanks in advance.