Override the MID Server selection filter

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 5분
  • Use the override feature to write your own filter condition that overrides the normal MID Server selection criteria for an application. An override has precedence over the default filter and can be defined for a specific selection condition.

    시작하기 전에

    Before attempting to create an override filter, be sure you understand the criteria the platform uses to select MID Servers. See MID Server selection for details.

    Role required: admin

    Setup indicator for configuration phaseEnsure that the MID Server can connect to elements inside and outside your networkDownload and install the MID Server on a Linux or Windows hostConfigure your MID ServerConfigure MID Server securityEnsure that the MID Server can connect to elements inside and outside your networkDownload and install the MID Server on a Linux or Windows hostConfigure your MID ServerConfigure MID Server security

    이 태스크 정보

    주:
    The override feature is intended for Cloud Management and Cloud Discovery only. The Override by capability filter is provided by default.
    There are four MID Server selection filters included in the base ServiceNow system. These filters are applied to all MID Servers in order until the system finds a matching condition:
    • Status Filter
    • App Filter
    • Capability Filter
    • IP Filter
    중요사항:
    The override feature allows multiple filter types but only one override filter for each filter type. The Override selector filter type overrides all other filters and takes complete control of the MID Server selection. If this type is active, it is the only filter applied.

    프로시저

    1. Navigate to All > MID Server > Mid Selector Override.
      The list of MID Server overrides appears.
    2. Select New to create a new filter.
    3. Complete these fields:
      • Name: Unique name for this override. Ensure that you can identify the override type by the name.
      • Script: Condition for this filter. Create the MID Server selection logic for your override in this field, using the directions provided in the function template. Look at the Override by capability filter as an example before starting to create your filter.
      • Type: Type of override being configured. Select one of the four default filters to override with your condition, or select Override selector to create a filter that overrides all the others.
    4. Select Submit.
      MID Server override filter script

    The Cloud Discovery schedule selects MID Servers based on Applications and Capabilities. To select different MID Servers for different service accounts, you can customize the MID Selector Override. After the line (function filter(/* MIDServerJS Array */ candidateMIDList, /* MIDServerJS Array */ defaultSelectedMIDList, /* Native JS object */ midSelectorContext, /* MIDSelectorParamJS */ requestedParameters) { add the following code with your information:

    var result = [];
    
     if (JSON.parse(midSelectorContext).service_account_id == '[example-account-id]') {
      for (var mid in defaultSelectedMIDList) {
       if (defaultSelectedMIDList[mid].sysId == '[example-MID-1]' || defaultSelectedMIDList[mid].sysId == '[example-MID-2]')
        result.push(defaultSelectedMIDList[mid]);
      }
      return result;   
     }