Info |
---|
The feature Browse objects in Cloudaware CMDB allows writing a query for objects and related fields of different levels to be displayed in a list view builder. Use Query Mode for the advanced view. |
...
Start
Select the resource type in question (e.g. AWS AccountsEC2 Instances) in CMDB Navigator to open the list views builder:
...
Click Browse Objects on the left. Select Query Mode to start working on a query.
...
In this example, we use the condition `Deleted From AWS` equals null to view all assets that are currently present in the cloud. You can write a query without conditions, type the fields one by one using a comma. The `Account`.`Account Name` is used to specify the object field Account from which the related field Account Name will be retrieved.
Note |
---|
This is an example of EC2 Instances object query. A query may consist of different components depending on an object. |
...
$.FieldName support numbers, letters and underscore only, e.g. $.abc_22. In cases you need to use other characters, refer to the format $["abc-22"].
...
Example: The filter `Tags JSON`[$.Name] equals "test" compares the value of the field 'Name' in the object 'Tags JSON' to the value 'test'.
You can type the number of the array's element or use wildcard symbol * to refer to all elements:
Example: `FieldName`[$["Field with whitespaces"][0][*]]
...
Use the following logical operators to filter out the data your query returns:
Equals = | Use for an exact match |
notEquals != | Use for an exact match with a certain value excluded |
greaterThan > | Use when you want results that exceed the value you enter |
greaterThanOrEqualTo => | Use for results that match or exceed the value you enter |
lessThan < | Use for results that are less than the value you enter |
lessThanOrEqualTo <= | Use for results that match or are less than the value you entered |
contains | Use for fields that include your search string |
notContains | Use to eliminate records that don’t contain the value you enter |
like | Use with % sign to locate records that include any part of the value you enter, e.g:`Account`.`Account Name` like "%test" or `Account`.`Account Name` like "%str%" |
notLike | Use with % sign to locate records that exclude any part of the value you enter, e.g:`Instance Name or ID` notLike "%environment" or `Instance Name or ID` notLike "%environ%" |
startsWith | Use for results that start with a certain value, e.g: `Instance Name or ID` startsWith "a" |
AND and OR operators are used for evaluating conditions you set up for your search.
...
Pay attention to the data format, it should be the following:
Date | Use a constant* from the drop-down list or type the date in the format YYYY-MM-DD |
DateTime | Use a constant* from the drop-down list or type the date in the format YYYY-MM-DDThh:mm:ss[.sss][Z] |
Time | Use a constant* from the drop-down list or type the date in the format hh:mm:ss[.sss][Z] |
* List of Date and DateTime constants is available here.
...
Note |
---|
[.sss] - milliseconds, [Z] - timezone are optional. |
...
You can extract more data from elements of JSON in the columns containing JSON data. Type a JSONPath expression* in the following way: [$.FieldName.FieldName2]
...
Examples:
The column Tags JSON`[$.Name] will contain values of the field 'Name'.
The column Policy Document JSON`[$.Statement[0]] will contain values of the first (0) element of the field array 'Statement'.The column Policy Document JSON`[$.Statement[*].Sid] will contain values of the field 'Sid' of all elements in the field array 'Statement'.
...