def METHOD_NAME(key):
    """
    Sort the json entries using the given key function, requires the log string
    to be proper json and to be a list
    """
    def _sort(log):
        log_json = json.loads(log, strict=False)
        log_sorted = sorted(log_json, key=key)
        return json.dumps(log_sorted)
    return _sort