def check_syslog_computer_field_mapping(workspace_id):
    '''
    Checking if the OMS agent maps the Computer field correctly:
    :return: True if the mapping configuration is correct, false otherwise
    '''
    grep = subprocess.Popen(["grep", "-i", "'Host' => record\['host'\]",
                             oms_agent_field_mapping_configuration], stdout=subprocess.PIPE)
    o, e = grep.communicate()
    if not o:
        print_warning("Warning: Current content of the omsagent syslog filter mapping configuration doesn't map the"
                      " Computer field from your hostname.\nTo enable the Computer field mapping, please run: \n"
                      "\"sed -i -e \"/'Severity' => tags\[tags.size - 1\]/ a \ \\t  'Host' => record['host']\""
                      " -e \"s/'Severity' => tags\[tags.size - 1\]/&,/\" " + oms_agent_field_mapping_configuration +
                      " && sudo /opt/microsoft/omsagent/bin/service_control restart " + workspace_id + "\"")
        return False
    else:
        print_ok("OMS Agent syslog field mapping is correct \n")
        return True

    Checking if the OMS agent maps the Computer field correctly:
    :return: True if the mapping configuration is correct, false otherwise
    
DataConnectors/CEF/cef_troubleshoot.py