I have a file where data packets comes at high speed. I want to extract all packets from main file to another file after finding ip.
Main file "Main.cap" -
Device:A
Host:B
IP:0.0.0.0
Time:123654
Device:B
Host:C
IP:1.1.1.1
Time:125423
Device:C
Host:D
IP:1.1.1.1
Time:129423
Device:E
Host:F
IP:1.1.1.1
Time:125423
Device:G
Host:H
IP:1.2.5.6
Time:12543
Now from this file if i want to extract all packets from IP 1.1.1.1
i.e. all 4 fields and all 3 packets then what should be done?
In short we have to grep this ip 1.1.1.1
and then find 2 new lines,one above this ip and one after ip.