Mask Operators

Masked tokens contain variable characters. You specify a masked token by using a mask string. This string consists of fixed characters and special mask operators. The two types of mask operators are optional and placeholder.

Optional Mask Operator

Use an optional mask operator to indicate that any number of characters up to the number you specify (0 to n) can appear at that position in the token. The format for the optional mask operator is \*n\, where n is the maximum number of optional characters, from 1 to 255. For example, the token TA\*2\ matches the following:

but does not match the following:

Placeholder Mask Operator

Use a placeholder mask operator to indicate that a given number of characters appears at the position of the token. The format for the placeholder mask operator is \?n\, where n is the required number of characters, from 1 to 255. For example, the token TA\?2\ matches the following:

but does not match the following:

Specifying a Backslash Character Within a Masked Token

You can specify a backslash as a character within a masked token by specifying two consecutive backslashes. For example, the masked token TA\\X\*2\ matches the following:

but does not match the following:

Using Masked Tokens in Standard Patterns

Because AMS searches for standard patterns more efficiently, you should try to avoid using nonstandard patterns. Sometimes you can use masked tokens in a standard pattern when the use of a nonstandard pattern might seem to be the only choice. For example, consider this message:

hostname:filesystem server not responding

where hostname is always 3 characters beginning with UN. If you specify a nonstandard pattern with the delimiter set { :} (space, colon), AMS creates these tokens:

hostname	filesystem	server	not	responding
	 1 			2 				3 		 4 			5

You can create the nonstandard pattern using these tokens:

TOKEN     FIXED 3 "server"
TOKEN     FIXED 5 "responding"
TOKEN     MASKED 1 "UN\?1\"

Although the nonstandard pattern matches the desired message, AMS has to examine it for every message. You can eliminate this extra search processing by using a standard pattern with a masked token. In this case, AMS would create these tokens:

hostname:filesystem  server  not  responding   
        1               2     3        4

You can create a standard pattern with these tokens:

TOKEN     KEYWORD 2
TOKEN     FIXED 4
TOKEN     MASKED 1 "UN\?1\:\*40\"

where:

UN\?1\

matches all the systems "UN" followed by one character.

\*40\

matches all file system names, assuming all the file system names are 40 or fewer characters. (Unlike the nonstandard pattern, it also matches if the file system name is omitted.)