def METHOD_NAME(command):
    """Execute shell command, return output, catch exceptions."""
    try:
        result = subprocess.check_output(shlex.split(command), stderr=subprocess.STDOUT, text=True)
        if "NOTICE:" in result:
            lines = []
            LOG.warning("NOTICE in output for: %s; cleaning output from datestamp..", command)
            for line in result.split("\n"):
                lines.append(re.sub(r"^.*NOTICE: ", "", line))
            # if the output is less than 3 lines something went wrong
            result = "\n".join(lines) if len(lines) > 2 else ""
        return result
    except (OSError, subprocess.CalledProcessError) as e:
        LOG.error("Error when runnning command %s: %r", command, getattr(e, "output", None))
        return ""