def has_host_match(log_data, hosts):
    """
    Match the data with a list of hostname patterns. If the log line data
    doesn't include host information considers the line as matched.
    """
    hostname = getattr(log_data, 'host', None)
    if hostname and hostname not in host_cache:
        for host_pattern in hosts:
            if host_pattern.search(hostname) is not None:
                host_cache.add(hostname)
                return True
        else:
            return False
    return True
Match the data with a list of hostname patterns. If the log line data
    doesn't include host information considers the line as matched.