Whoa, unless I'm misinterpreting your intentions you're doing this way harder and heavier than it needs to be.
The key thing here is to make sure you can get the error messages extracted to a field that you can match against (let's call it errorTag in both the lookup and the field extraction). After that you can easily get your results through a rewritten search looking something like this:
index=app_index source=*/application.log [inputlookup knownErrorList.csv | fields errorTag] | stats count by errorTag
If you're hitting the subsearch limit, you could do this:
index=app_index source=*/application.log errorTag=* | lookup knownErrorList.csv errorTag OUTPUT component | search component=* | stats count by errorTag
Again, the key thing is to create that field extraction. If the placement of these error messages are completely random you could:
a) go punch your developers in the face, and/or
b) create a field extraction that simply matches each error string explicitly - like, REGEX = (Error String 1|Error String 2|Error String 3|...)
... View more