Added pattern matching to extract the log entries