pipe logs into shell script