in reply to Re^2: search and extract lines which contain a word
in thread search and extract lines which contain a word

you can have multiple alternatives:

if /(gateway|TIMESTAMP)/

A paren around the collection of alternatives, a | between each alternative.