cat file | grep -h -o '([0-9]{1,3}\.){3}[0-9]{1,3}\:[0-9]{1,4}' cat file | cut -d ' ' -f 3 cat file | awk '{print $2}'