That is a very vague description. Please be way more detailed and specific. Why should we select 2914 | REQUEST and not 2986 | REQUEST ? Your code snippet would print a "REQUEST" line and the very next "RESPONSE" line coming up, independent of contents.
If understood your requirement correctly then following may help you in same where you need to have columns values in sequence of REQUEST RESPONSE SUCCESS and column 1 should have all 3 then only it should print it. If you have some other requirement please let us know with sample input and all conditions with sample expected output.
awk -F' +| +' 'FNR==NR{A[$1 OFS $3]=$0;next} (($1 OFS "REQUEST") in A){O=A[$1 OFS "REQUEST"];B[$1]++} (($1 OFS "RESPONSE") in A){O=O ORS A[$1 OFS "RESPONSE"];;B[$1]++} (($1 OFS "SUCCESS") in A){O=O ORS A[$1 OFS "SUCCESS"];;B[$1]++}{if(B[$1]==3 && O !~ /^$/){print O;O="";}}' Input_file Input_file
if you are sure that it is impossible for either of REQUEST/RESPONSE/SUCCESS to appear more than once in terms of your key from column 1. Then below awk should work for you.
awk 'BEGIN{FS=" +| +"}
{
arr[$1]=arr[$1]"\n"$0
brr[$1]++
}
END{
for(i in arr)
if(brr==3)
print arr
}' a
python
import re
lines={}
actions={}
with open("a.txt") as file:
for line in file:
items=re.compile("\s+|\s+").split(line)
if items[0] in lines:
lines[items[0]]=lines[items[0]]+line
else:
lines[items[0]]=line
if items[0] in actions:
actions[items[0]]=actions[items[0]]+'_'+items[2]
else:
actions[items[0]]=items[2]
for key in lines:
if 'REQUEST' in actions[key] and 'RESPONSE' in actions[key] and 'SUCCESS' in actions[key]:
print(lines[key])