select a line that contains the strings

hi
i have a file, from the file i need to extract the lines that contains both 17 and Received msg string, i used
cat <filename> | grep 17 | grep "Received msg" > <new file>

but it is not giving the required o/p

please help

thanks in advance
Satya

bijayant@bijayant ~ $ cat test
hi this is bijayant 17
Received message 17
17 Received message
18 Received message
19 Received message
Bijayant Received message
Bijayant 17 Received message
17 Received message

bijayant@bijayant ~ $ grep -i "17.Received message\|Received message.17" test
Received message 17
17 Received message
Bijayant 17 Received message
17 Received message

awk '$0 ~ /17/ && $0 ~ /Received message/' file

The previous two messages provide examples of code to find your lines from the file. The other issue that sometimes is a problem is in finding the number 17 since it can be part of 617 and 179. Thus, you may need to modify the grep for this to one of the following:
" 17 "
"17 "
" 17"

Depending on where you expect the 17 to be on the line, you might want to force a space character before/after or both.