PRIORITY Command

You can control the order in which patterns are compared against each message by assigning a pattern PRIORITY of 0 to 255. The lower the number, the higher the priority. AMS compares messages to patterns with lower numbers before patterns with higher numbers.

For standard patterns, AMS uses the priority to determine the search order for patterns that share a keyword in the same token position. If a message matches patterns with different keywords, the priority has no effect. In this situation, the search order is unpredictable. Note that this is a different situation than described in the following paragraph.

AMS searches standard patterns without keywords and nonstandard patterns strictly in order of priority. If two or more of these patterns are given the same PRIORITY value, the search order is unpredictable.

Format

PRIORITY integer

where integer is the priority associated with the pattern, from 0 (highest priority) to 255 (lowest priority). The default value is 128.

SP-AMS Examples

The following messages are part of the output from the UNIX command df -v:

/   /dev/root  400816  320296  80520  79% 
/   /dev/root  400816  360735  40081  90%

The following patterns illustrate how these messages would be matched based on the priorities defined in the patterns:

DEFINE  "group1" 1
   MESSAGE "/ /dev/root blocks used free 9\?1\%"    
   PRIORITY 120   
   TOKEN KEYWORD 2 "/dev/root"   
   TOKEN MASKED 6 "9\?1\%"     
   .     
   .     
   .
DEFINE  "group1" 2
   MESSAGE  "/ /dev/root blocks used free used%"
   TOKEN KEYWORD 2 "/dev/root"

From this example, we can determine the following:

The next example defines a test pattern and also assigns it the next pattern number in group group2. The pattern is given the lowest priority of 255, so it is searched last.

DEFINE "group2"
 MESSAGE "THIS IS A USER MESSAGE"
 TYPE TEST
 PRIORITY 255

CP-AMS Examples

Assume the following two OS 2200 console messages:

BKG ERROR FIN

CMS ERROR FIN
			

The following patterns illustrate usage of the PRIORITY command:

DEFINE "group1" 1
    MESSAGE  "CMS ERROR FIN"
    TYPE PRIVILEGED-EXEC
    PRIORITYM 120
    TOKEN KEYWORD 2 "ERROR"
    TOKEN MASKEDM 1 "CMS\*3\"
END
DEFINE "group1" 2
   MESSAGE "run-id ERROR FIN"
   TYPE PRIVILEGED-EXEC
   TOKEN KEYWORD 2 "ERROR"
END

From this example, we can determine the following:

Note: Since the Exec sends "ERROR FIN" messages, you could not specify "CMS\*3\" as a RUNID token (see 2.10). Although BKG and CMS are run-ids, you cannot use a run-id token to match them. Here they are part of the normal message text and so can be matched only using a keyword, fixed, or masked token. Remember that the RUNID token is used to match the generated run-id attribute of a console message. For Exec messages, this attribute is blank. For privileged and nonprivileged messages, this generated run-id and the following asterisk are stripped off by AMS.