def get_tp_from_file(file_path):
    """Return the name of the topic-partition given the path to the file.

    :param file_path: the path to the log file
    :type file_path: str
    :returns: the name of the topic-partition, ex. "topic_name-0"
    :rtype: str
    """
    match = TP_FROM_FILE_REGEX.match(file_path)
    if not match:
        print("File path is not valid: " + file_path)
        sys.exit(1)
    return match.group(1)