extract message

thx
thx

awk '/hello world/ { print "hello world"; next }
{ print "Do nothing" }' FILENAME 

More generally:

message=whatever
awk  '/'"$message"'/ { print "'"$message"'"; next }
{ print "Do nothing" }' FILENAME