Tokens are the building blocks of AMS patterns. They are usually numbered from left to right, 1 to n. Delimiters separate a pattern into tokens. Tokens are necessary to identify a message uniquely.
Assuming the default delimiters of spaces, the tokens in this sample message are numbered as follows:
Token Types
In an autoaction database, you can define the types of tokens in your patterns to improve the efficiency of pattern matching. Table 1–1 shows the five types of tokens available.
For most efficient pattern matching, define only the tokens necessary to identify a message uniquely.
Table 1. Tokens
Type | Definition |
---|---|
FIXED | A string of characters that must match the message token exactly, character for character. |
KEYWORD | A special type of fixed token that is the most distinguishing portion of a message. Standard patterns are processed most efficiently when defined with a keyword token. |
MASKED | A type of token used to match variable text within a message. |
HOSTID[SP-AMS] | A special type of token used by SP-AMS to identify a message from a particular host system. Host-id tokens can also be masked. Host-id is not visible in any system message, but you can define it as a token in your patterns and match messages only from the host named by the host-id token. |
RUNID[CP-AMS] | A special type of masked token used by CP-AMS when the action must depend on the value of the run-id generating the message. Note: Exec messages have a blank run-id. |
Negative Token Numbering
Tokens can also be numbered from right to left, –1 to –n. Negative token numbering can be simpler than numbering tokens from left to right if you want to match a message that has a variable number of tokens or you want to match a token near the end of a message.