import re


def hostname_from_message_id(message_id):
    """
    Get the hostname value from this message ID header.

    It seems all messages from Jenkins have a message ID that includes the
    FQDN.

    :param message_id: STOMP header string, eg.
                       "ID:ceph-jenkins.example.com-44193-1511460447792..."
    :returns: hostname string, eg. "ceph-jenkins.example.com", or None if we
              found no FQDN in the message ID.
    """
    r = re.match('ID:(.+)-\d+-', message_id)
    if r:
        return r.group(1)