I have very long log files, is it possible to ask grep to only search the first 10 lines?
You have a few options using programs along with grep. The simplest in my opinion is to use head:
grep
head
head -n10 filename | grep ...
head will output the first 10 lines (using the -n option), and then you can pipe that output to grep.
-n