Write a script to parse a large log file and extract specific error patterns while maintaining memory efficiency.