Working with criteria and filter expressions in the Operations Manager 2007 adapter

This section provides information about working with criteria and filter expressions in the BMC Atrium Orchestrator Application Adapter for Microsoft System Center Operations Manager 2007.

Filter expressions

The following table illustrates examples of using different operators with filter expressions.


Table of filter operators

Operator

Example

True/False

equals

10 equals 10

true

not equals

10 not equals 10

false

matches

"book" matches "[iou]"

true



For the operator matches, the expression can assume the following formats:


Formats for matches filter operator

Format

Logic

Example

value

Matches exact characters anywhere in the original value

"book" matches "oo"

. (dot)

Matches any single character

"copy" matches "c..y"

[value]

Matches at least one of the characters in the brackets

"big" matches "b[iou]g"

[range]

Matches at least one of the characters within the range Use hyphen (-) to specify contiguous characters.

"and" matches "[a-e]nd"

Criteria expression syntax

You can construct a criteria expression to retrieve objects in the Microsoft System Center Operations Manager 2007 database. The following sections provide syntax reference information that is useful when creating a criteria expression.

Comparison operators

You can use the following comparison operators when constructing a criteria expression:

Comparison operators

Operator

Description

Syntax

equals

Evaluates to true if the left and right operands are equal

mymachine.mydomain.com

not equals

Evaluates to true if the left and right operands are unequal

mymachine.mydomain.com

like

Evaluates to true if the left operand matches the pattern that is defined by the right operand

Use the characters in the wildcard characters table to define the pattern.

'SQL%'
Evaluates to true if the Name value is "SQLEngine."

'%SQL%'
Evaluates to true if the Name value is "MySQLEngine."

in

Evaluates to true if the value of the left operand is in the list of values defined by the right operand

Note

The in operator is valid for use only with properties of type globally unique identifier (GUID).

080F192C-52D2-423D-8953-B3EC8C3CD001,080F192C-53B2-403D-8753-B3EC8C3CD002

Evaluates to true if the value of the Id property is one of the two GUIDs specified in the expression.

and

Evaluates to true if the left and right operands are both true

Name = 'SQL%' and Description LIKE 'MyData%'

or

Evaluates to true if the left or right operand is true

Name = 'SQL%' or Description LIKE 'MyData%'

Note

For all the operators except in, if the value contains a comma (,) as one of the characters, the value is included in single quotation marks so that the value is interpreted as single value rather than a set of comma-separated values. For example, 'test,test'.

Wildcard characters

The following table defines the wildcard characters that you can use to construct a pattern when using the LIKE operator:


Wildcard characters

Wildcard

Description

Example

%

Specifies a wildcard that matches any number of characters

Name LIKE 'SQL%'
Evaluates to true if the Name value is "SQLEngine."

Name LIKE '%SQL%'
Evaluates to true if the Name value is "MySQLEngine."

_ (underscore)

Specifies a wildcard that matches a single character

Name LIKE 'SQL200_'

Evaluates to true for the following Name values:

"SQL2000"
"SQL2005"

Note

The expression evaluates to false for "SQL200" because the symbol _ must match exactly one character in the Name value.

[ ]

Specifies a wildcard that matches any one character that is enclosed in the character set

Note

Brackets are also used when qualifying references to MonitoringObject properties.

Name LIKE 'SQL200[05]'

Evaluates to true for the following Name values:

"SQL2000"
"SQL2005"

The expression evaluates to false for "SQL2003."

Was this page helpful? Yes No Submitting... Thank you

Comments