Test pattern matching
HP Operations provides the ability to test the match patterns that
you write for your policies. You can test either individual
patterns, or all the patterns in one policy. It is a good idea to
test the pattern matching in your
rules, to
make sure that the policy actually produces the kinds of messages
that you want to receive.
- To test all rules, select the Rules tab in the policy
editor and select Matching test..
To test one rule, right-click in the text box that contains the
pattern you want to test, and select Matching test...
The match patterns from all rules in the policy are
visible in the upper window, titled Patterns to
test.
- Click Copy from file..., navigate to a file that
contains text against which you want to test your patterns, and
click OK. The file will be visible in the Lines to
match dialog. If you don't want to load an entire file, you can
select Add Line... and type a few lines that you can use for
the test. You can edit the lines in the window if you want to
change the test.
- Click Test patterns and all the patterns will be tested
against the lines to match. The Status column indicates if
the one of the patterns matched each line, and the Rule No.
column indicates which rule or rules matched.
If you did not get the results that you expected, you can
double-click any pattern or line to match, modify it, and try
again.
NOTE:
Remember that the rule order is important. If rule number 1 matches
a line, that line will not be tested against any other
rule.
- If you want to use the changes you have made, select
Apply changes.
Related Topics: