I am searching something logs at the following directory
$ cd opt/app/abc/logs
Now the logs folder contains many different logs like
Just output the command to a file:
grep -l 456 * > somefile.txt
You can do this for any command.
Is this what you're looking for?
grep '456' * > outfile