A literal string is a string of characters where each individual character takes on its own alphanumeric value.
A regular expression is a string of characters where certain characters have special meanings that affect the way the text is interpreted. These characters are called metacharacters.
The regular expression metacharacters you can use are listed in the following table.
|
Expression |
Description |
Example |
|---|---|---|
|
^ |
Matches one or more of CR, LF or FF |
Event Text to scan for^ |
|
. |
Matches any single character |
Disk USER. offline |
|
\ |
Uses the following character literally |
SALT$DKA0: \[SYS0\.SYSCOMMON\.\] \[SYSEXE\]LOGINOUT\.EXE |
|
[] |
Matches a range of characters specified within the brackets |
[@%$] |
|
* |
Matches 0 or more characters on the same line of console output |
Disk*offline |
|
# |
Matches on 0 or more whitespace characters on the same line of console output |
Event#Text to scan for |
Note: When using the “[]” operators, the following special meaning is given to the “^” and “-” symbols:
An example of the difference between a literal and a regular expression would be matching the text FRED*JONES:
Note: Console Manager does not support the matching of text over multiple lines through the use of the “^” metacharacter. The beginning and end of the line on which the match is found bound all event matches.
When you specify the text that is used to generate an event, ENS examines the console line of the serviced system(s) for which the event is defined. As soon as the specified text is matched, ENS sends the event immediately.
To ensure that you receive the complete line of text for the event, then add the metacharacters “*^” to the end of the text for the event, for example:
Security alarm on*^
This will trigger an event when the text "Security alarm on" is found, followed by any number or combination of characters terminated by either carriage Enter, line feed or form feed. All action routines will now receive the complete line of text that triggered the event.
|
Copyright © 2010 CA.
All rights reserved.
|
|