Searching for CIs using a custom query in advanced search
You can create custom queries to search for configuration items (CIs) by specifying criteria such as the related class of the CI, specific attribute values of each class, and the relationship that the two related classes share.
The following video shows an example of how you can create a custom query:
The example search shown in the video shows you how to create a custom query for a computer by entering the following criteria in the query builder:
|Reconciliation ID||ID with a nonzero value|
BMC CMDB builds the following search query for this example:
BMC.CORE:BMC_ComputerSystem, qualification = 'Category' = "Hardware" AND (('NormalizationStatus' = "Not Normalized") OR ('ReconciliationIdentity' != 0)) related to :BMC.CORE:BMC_NetworkPort, qualification = 'ManufacturerName' = "Dell"
Search operators, keywords, and wildcards
You need various operators, keywords, and wildcards to build a search query. The following information helps you understand the usage of operators, keywords, and wildcards.
The operators match specified attributes to specific values.
|Operator||Action||Example query and results|
Matches contents that are exactly equal to the value.
Matches contents that are less than the value.
Matches contents that are greater than the value.
|!=||Matches contents that are not equal to the numeric or a string.||Not provided.|
Matches contents that are greater than or equal to the value.
Matches contents that are less than or equal to the value.
|For a class |
|()||Use these parentheses to create groups or to specify the order in which the operations are to be performed.||Not provided.|
Adds two integer, real, or decimal values. Adds an integer, real, or decimal interval to a time value. Real and decimal values are truncated to an integer value. Concatenates two character strings.
Performs any of the following calculations:
Multiplies two integer, real, or decimal values.
Divides two integer, real, or decimal values.
Enclose strings and dates when you create your query in the Build Qualification dialog box.
|To search for all requests created after a certain date, use |
If you want to search for a string such as:
|'||Single quotation marks are automatically added when you select attributes.||Not provided.|
The dollar signs ($) on either side of a keyword signify the value assigned to the keyword.
Logical AND of the result of two conditions. The result is true if both conditions are true.
Logical OR of the result of two conditions. The result is true if one of the conditions is true.
Negates the condition that follows. If the condition is false, the result is true.
Performs a pattern search using wildcard characters.
Matches any string of zero or more characters.
Keywords return or represent defined values.
|The current user login. A "user" can refer to either a human user or an internal (system) user. An internal user can be an escalation "user" (AR_ESCALATOR user), a DSO action (Distributed Server user), or an application binary (such as Remedy Application Service user).|
For date or time fields, this keyword evaluates to the current date, and the time is set to midnight by default. Anything stored in a date or time field is stored as the number of seconds since UNIX time, which includes the date and time.
UNIX time (also known as POSIX time or UNIX Epoch time) is a system for describing a point in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.
Note: When using $DATE$ in a search on a Date or Time field, you can add or subtract date/time by using a value that is based on seconds. For example:
Today's date in UNIX time.
A null value (no value).
BMC CMDB treats a NULL value as follows:
When you use multiple operators to create qualification criteria, they are evaluated in the following order:
NOT (!) -(unary minus; an operator that takes only one operand; for example, -2.5)
/ % *
< <= > >= !- LIKE
Operators of the same precedence are performed left to right.
You can use parentheses in an expression to override operator precedence. BMC CMDB evaluates expressions inside the parentheses first before evaluating those outside the parantheses.