Multithreaded script for log processing