def list_logfile(flist):
    """ this read from file list of instances from download log file and return the ones matching constraints """
    keys = ['variable', 'mip', 'model', 'experiment', 'ensemble', 'realm',
        'version', 'dataset_id', 'path', 'cks_type', 'files']
    file_keys = ['filename', 'tracking_id', 'checksum']
    f = open(flist, 'r')
    inst_list = []
    file_list = []
    lines = f.readlines()
    values = lines[0].replace('\n', '').split(',')
    ds_dict = dict(zip(keys[:-1], values))
    for line in lines[1:]:
        values = line.replace('\n', '').split(',')
        if len(values) < 5:
            file_list.append(dict(zip(file_keys, values)))
        else:
            ds_dict['files'] = file_list
            inst_list.append(ds_dict)
            file_list = []
            ds_dict = dict(zip(keys[:-1], values))
    ds_dict['files'] = file_list
    inst_list.append(ds_dict)
    f.close()
    return inst_list
