To every rule there is a number assigned as the rule is defined. The rules then are subsequently iden-
tified by their numeric value.
It is also possible to delete all defined or partially defined rules by issuing the following command
HAO CLEAR
13.4 Substituting Substrings
The command may contain special variables ($1, $2, $3, etc.) which will be replaced by the values of
“capturing groups” in the match pattern. A capturing group is a part of the regular expression enclosed in
parenthesis which is matched with text in the target message. In this way commands may be constructed
which contain substrings extracted from the message which triggered the command.
The following special variables are recognized:
expression.
Note that the substitution of a $n variable does not occur if there are fewer than n capturing groups in the
regular expression.
13.5 Limitations
The current implementation limits the total number of defined rules to 64. This limit may be raised by in-
creasing the value of the HAO_MAXRULE constant in module “hao.c” and rebuilding Hercules.
All defined rules are checked for a match each time Hercules issues a message. There is no way to
specify “stop processing subsequent rules”. If a message is issued that matches two or more rules, each
associated command is then issued in sequence.
13.6 Examples
Example 1:
Issue the command “i 0700” in response to the message:
HHC01090I 0:0700 COMM: client 127.0.0.1 devtype 3270: connection reset
The following HAO commands define the desired rule:
HAO TGT HHC01090I 0:([0-9A-F]{3,4})
HAO CMD i $1