Extract the host and service name strings before combining them.