Write a script to parse a large log file and extract specific error patterns, optimizing for memory usage.