How to eliminate the domain name from a discovered element name

Document ID : KB000023295
Last Modified Date : 14/02/2018
Show Technical Document Details


Most often this environment variable would be used to remove the domain name added to element names during discovery.


The variable is defined within the eHealth Administration Reference Guide. It is found on page 56 in the Admin Reference guide.


eHealth (all versions)
All supported platforms
Environment Variable NH_NAME_SRVC_PAT



The environment variable NH_NAME_SRVC_PAT specifies a regular expression that indicates the portion of the name to truncate.

Default Value: "\..$" (for UNIX and Windows)
Valid Values: Any regular expression.
Usage Notes: To use this variable, you must also set the NH_USE_NAME_SRVC variable (page 57 in the Admin Reference guide) to DNS. This variable causes the discover process to truncate the name or address at the first period in the name. The following examples use the string to show various expressions and their results:

"" results in
"\..$"results in smsp1ja1
"\.com"results in
"\.mwa\.com"results in
"\.abc\.mwa\.com"results in smsp1ja1


Another example of how to utilize this variable is when there is more than one domain name that needs to be truncated. For example, if the need is to:

Removing the domain which in this example is our most common domain to be seen during discovery (99%). Say we need them to become: -> aa01.wm ->

Meanwhile, there is also a small number of domains that are in the domain of which is seen during discovery but is rare (<1%). Say we need these to become: -> nocmgt02.noc -> nocmgt

This presents a small challenge as you can only set the variable once, with one value. How do you get around this? With the - symbol. In this instance the variable would be set to:

NH_NAME_SRVC_PAT = "(\.foofy\.com)-(\.foofytech\.org)"


CAUTION:  Contact Technical Support if you have difficulty setting this variable.


Additional Information:

TEC513393 - How to Set or Change eHealth Environment Variables in Windows

TEC513391 - How to Set or Change eHealth Environment Variables in Solaris/Linux