def strip_non_ecs_options(subset):
    for key in subset:
        subset[key] = {x: subset[key][x] for x in subset[key] if (x in ecs_options)}
        if (('fields' in subset[key]) and isinstance(subset[key]['fields'], dict)):
            strip_non_ecs_options(subset[key]['fields'])
def strip_non_ecs_options(subset):
    for key in subset:
        subset[key] = {x: subset[key][x] for x in subset[key] if (x in ecs_options)}
        if (('fields' in subset[key]) and isinstance(subset[key]['fields'], dict)):
            strip_non_ecs_options(subset[key]['fields'])