tail -f $log_file | \ grep "is blacklisted" | \ sed -n 's/.*\[\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\)\].*/\1/p' | \ while read line do echo "found $line" done