Consider a log file which looks like this:
action A detail 1 detail 2 detail 3 action X detail 1 detail 2 action B detail 1 action X detail 1 detail 2 action C
Lines with "action [ABC]" may have various number of following "detail"-lines.
Lines with "action X" always have 2 following "detail"-lines.
I am not interested in event X so I would like to filter out all lines with "action X" and the following two lines.
I am aware of the
-v flag, just not how to express the "and the following 2 lines" part.