def find_dcr_cloud_environment():
    """
    Use the agent config on the machine to determine the cloud environment we are running in
    """
    command_to_run = "if grep -qs \"azure.cn\" {0}; then echo \"MK\"; elif grep -qs \"azure.us\" {0}; then echo \"Gov\"; else echo \"Prod\"; fi".format(
        AGENT_CONF_FILE)
    try:
        command_result, command_result_err = subprocess.Popen(command_to_run, shell=True,
                                                              stdout=subprocess.PIPE,
                                                              stderr=subprocess.STDOUT).communicate()
        machine_env = command_result.decode('utf-8').strip("\n")
        return machine_env if machine_env is not None else DEFAULT_MACHINE_ENV
    except Exception:
        return DEFAULT_MACHINE_ENV

    Use the agent config on the machine to determine the cloud environment we are running in
    
DataConnectors/Syslog/Sentinel_AMA_troubleshoot.py