You can use the following command:
$ grep -oh -e aaa -e bbb ./logs | sort | uniq -c
man grep, you can read:
Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.
Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to
-e is used to match either one. Then, the results are sorted and counted using