CExpr.exe
This program provides access to the BMC Defender Server expression functions. The program can be used as a simple filter, reading standard input, and output records that match the specified expression. Each expression can consist of keywords, wildcards, logical combinations joined by and, or, not functions, as well as BMC Defender macros. Refer to the BMC Defender Expression help for detailed information.
Usage and Syntax
Also: cexpr.exe -file (infile) "(expr)"
Also: cexpr.exe –file (infile) –qfile (queryfile)
Arguments
-file | This argument, if it exists, is the input file to process. The input file must be followed by a valid (infile) argument, that is the pathname of the file to process. If this option is omitted, the CExpr program reads standard input and writes the matched results to standard output. |
(infile) | This argument must follow the -infile argument, and is the full or relative pathname of the file to process. |
(expr) | This argument is any BMC Defender expression, including keywords, wildcards, and match expressions, logical parenthetically organized lists of expressions, macros, and combination of macros, and lists. The argument must be in double quotes if it contains any spaces. |
-qfile | This argument if it exists, is the pathname to a file containing the query to execute. The argument must be followed by the name of the file containing the query to execute. This argument cannot be used if an expression is specified on the command line. |
(queryfile) | This argument must follow the -query argument, and is a file that contains the expression. The file should contain a valid query (possibly spanning multiple lines.) Multiple blanks are stripped from the final expression. This provides a method of specifying a match expression that is involved to enter into the command line. |
Application
The CExpr.exe program is commonly used as a filter to match specific values in the input stream (either standard input of the name of the file specified by the -file option.) The program operates as a find or grep type command line utility, except the program accepts the rich assortment of BMC Defender Server match expressions available for use in correlation threads and other BMC Defender program locations. This provides a simple and powerful way to extract specific messages from an input stream or file.
The output of the program consists of lines that satisfy the expression.
In particular, the program accepts:
- Simple keywords.
- Keywords with wildcard characters (*) or (?) or (^).
- Logical combinations of keyword separated by and, or, not, xor.
- Macro values found in the Correlation > Macros and Correlation > Lists screens.
The expression passed to the program should be double-quoted. If the match pattern contains a double-quote (as might often be the case) the double-quote character should be escaped with a backslash and character, or you can substitute a single quote within the double quotes.
Help on BMC Defender expressions can be found in various locations, including the Expression Help hyperlink found on various BMC Defender Server screens.
Related topic