You should look into regular expressions. Something like this might get what you want:
egrep "1234|5678|9012|3456" binary_log_file
- egrep launches grep with support for basic regular expressions
- "1234|5678|9012|3456" means to match any line that contains one or more of 1234, 5678, 9012, and 3456.
- binary_log_file is, of course, the file you want to grep against
Replace the four-digit numbers I used with the IDs you're looking for.
Keep in mind, this will cause grep to display all matching lines in whatever order they occur in the file.
EDIT: My mistake, you do not need the escape character if the grep string is in double quotes