Searching 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 example search shown in the video shows you how to create a custom query for a computer by using the following criteria:
Normalization status: '
Reconciliation ID: ID with a nonzero value.
BMC CMDB displays displays the following completed 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 help match various attributes to specific values.
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.|
Matches contents that are greater than or equal to the value.
Matches contents that are less than or equal to the value.
For example, for a class
|()||Use these parentheses to create groups or to specify the order in which the operations are to be performed.|
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.
Encloses strings and dates where required when you create your query in the Build Qualification dialog box.
For example, to search for all requests created after a certain date, use:
|Single quotation marks are automatically added when you select attributes.|
|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 either condition is true.)
Negates the condition that follows. (If the condition is false, the result is true.)
Performs a pattern search using wildcard characters.
Keywords return or represent defined values.
|The current user login. A "user" can be a human user or an internal (system) 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 epoch 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 epoch time.
A null value (no value).
BMC CMDB treats a NULL value as follows:
Wildcards are characters that are used in a search to represent other characters.
Matches any string of zero or more characters.
Example: J%son matches Jackson, Johnson, Jason, and Json. To include leading and trailing characters, you must use the % symbol. To match Jill Bobbington, Bobby Fenton, Bob Compton, and Bob Stone you can enter "%Bob%ton%"
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.