I have the following content and a file called file.txt
TIMESTAMP 200 J8899
INSTANCES 19 x86_64 False i-xxx1a1a t2.medium True subnet-93b224fb hvm vpc-7b801
STATE 16 running
TIMESTAMP 300 J2099
INSTANCES 18 x86_64 False i-xxx1a1b t2.medium True subnet-93b224fb hvm vpc-7b801
STATE 16 running
Now I want to print the following output
i-xxx1a1a : running
i-xxx1a1b : running
Please note line starting with TIMESTAMP, INSTANCES, STATE
are new lines
I tried doing this but it didn't work
grep -Ew "INSTANCES|STATE" file.txt | awk '{print $0}'