This documentation supports the 18.08 version of BMC Atrium Core.

To view the latest version, select the version from the Product version menu.

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.

This image shows the location of the custom search option

 https://youtu.be/43KYCqXj0Qs

The example search shown in the video shows you how to create a custom query for a computer by using the following criteria:

Category: 'Hardware'.

Normalization status: 'Not Normalized'.

Reconciliation ID: ID with a nonzero value.

Manufacturer: Dell.

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.

Operators

The operators help match various attributes to specific values.  

OperatorAction
=

Matches contents that are exactly equal to the value.

For example, 'Status'=0 finds all requests with a status value equal to zero.

<

Matches contents that are less than the value.

For example, 'CreateDate'<($DATE$-86400) finds all requests created more than 24 hours ago (where 86400 is the number of seconds in 24 hours).

>

Matches contents that are greater than the value.

For example, 'CreateDate'>"10/31/05 00:00:00" finds all requests created after midnight on October 31, 2005.

!=Matches contents that are not equal to the numeric or a string.
>=

Matches contents that are greater than or equal to the value.

For example, 'CreateDate'>="10/31/05" finds all requests created on or after October 31, 2005.

<=

Matches contents that are less than or equal to the value.

For example, for a class BMC_Person, 'Salary'<=10000 finds all requests with contents of the Salary field less than or equal to 10000.

()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.

For example, 'CreateDate'>$DATE$+28800 finds all requests created after 8:00 A.M. today (where 28800 is the number of seconds in 8 hours).

-

Performs any of the following calculations:
• Subtracts two integer, real, or decimal values.
• Subtracts two time values (resulting in an integer).
• Subtracts an integer, real, or decimal interval from a time value. (Real and decimal values are truncated to an integer value.)

For example, 'Create Date'>$DATE$-604800 finds all requests created within the last seven days (where 604800 is the number of seconds in one week).

*

Multiplies two integer, real, or decimal values.

For example, 'Quantity' * 'Price'>50 finds all requests where the contents of the Quantity field multiplied by the contents of the Price field is more than 50.

/

Divides two integer, real, or decimal values.

For example, 'Yearly Expenses'/12>8000 finds all requests where the average monthly expense is greater than $8,000.

"

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: 'CreateDate' > "04/01/04".
If you want to search for a string such as: Robert "Bobby" Smith, enter: "Robert ""Bobby"" Smith"

'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.
AND

Logical AND of the result of two conditions. (The result is true if both conditions are true.)

OR

Logical OR of the result of two conditions. (The result is true if either condition is true.)

NOT

Negates the condition that follows. (If the condition is false, the result is true.)

For example, NOT 'Status'="New" finds all requests that are not new. You can use the symbol ! instead of the word NOT.

LIKE

Performs a pattern search using wildcard characters.

For example, 'Submitter' LIKE "Bob%ton" finds all requests with a submitter name that begins with the letters "Bob" and ends with the letters "ton", such as Bob Compton and Bobby Fenton.

Keywords

Keywords return or represent defined values.

KeywordAction
USERThe current user login. A "user" can be a human user or an internal (system) user. 
DATE

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: dateTimeField> $DATE$ - 86400 (86400 is the number of seconds in 24 hours.) For Date fields, this keyword evaluates to the current date. For Time fields, this keyword evaluates to 12:00:00 AM.

Note: The $DATE$ keyword is not expanded when default values are set. This allows the value to be set to the date the form is submitted rather than the date the form is opened.
TODAY

Today's date in Unix epoch time.

NULL

A null value (no value).

BMC CMDB treats a NULL value as follows:
• Character, Diary, Timestamp, Selection — An empty string
• Integer, Real, Decimal — A value of 0

Wildcards

Wildcards are characters that are used in a search to represent other characters.

WildcardAction
%

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%"

Operator Precedence

When you use multiple operators to create qualification criteria, they are evaluated in the following order:

  1. ( )
  2. NOT (!) - (unary minus; an operator that takes only one operand; for example, -2.5)
  3. / %
  4. + -
  5. < <= > >= !- LIKE
  6. AND 
  7. OR

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.

Resources

More about Unix Epoch Time

Convert to Epoch time

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

Comments