Just isolate the host part and do a $gettok(host,-1,46) and maybe check if it's not a number (in cases where the host is an IP address).