def METHOD_NAME(fn):
    """
    Execute fn with each element of the list in order
    """
    def _foreach(log):
        logs = json.loads(log, strict=False)
        for log_item in logs:
            fn(log_item)
        return json.dumps(logs)
    return _foreach