The Obcerv entity expressions allow you to filter Obcerv data before performing operations or creating visualisations. It is a high level language for working with the Obcerv data model.
The expressions language is used in the following places:
This document provides an explanation of the syntax used for these expressions. In general, expressions take the form:
key operator value
where the key is an attribute or dimension name.
If you are using an attribute as your key, such as a classification attribute, then you can also specify a namespace:
namespace.key operator value
If a namespace is supplied, the expression will only match the attribute with the given namespace and name. However, if no namespace is supplied then the expression will match any attribute with the given name regardless of its namespace.
Obcerv uses a namespacing system so that dimensions and attributes can use the same structure in many contexts without interference. For more information, see Architecture
Variables can be of the following types:
|Array||An ordered list.||
|Set||An unordered list.||
|String||A string literal. If the string contains spaces it must be contained in quotes.||“my string”|
|Equals||=||name = myserver1||If the first term does not exist then this evaluates as false.|
|Not equals||!=||department != hr||If the first term does not exist then this evaluates as true.|
|Greater than or equals||>=||disk_size >= 100000|
|Greater than||>||mem_size > 16000|
|Less than or equals||<=||mem_size <= 4000|
|Less than||<||disk_size < 10000|
|Equals||=||hierarchy = [ ’namespace’, ‘pod’, ‘container’ ]||If the first term does not exist then this evaluates as false.|
|Not equals||!=||hierarchy != [ ’namespace’, ‘pod’, ‘container’ ]||If the first term does not exist then this evaluates as true.|
|Starts with||STARTS WITH||hierarchy starts with ‘pod’|
|Contains all||CONTAINS ALL||hierarchy contains all [ ’namespace’, ‘pod’, ‘container’ ]|
|In||IN||department in (hr, finance, engineering)|
|Not in||NOT IN||department not in (hr, finance, engineering)|
|Does not exist||NOT EXISTS||region not exists|
Note: Dimensions or attributes containing the empty string are a special case, and are treated as if they do not exist by existence operators.
|And||AND||name != server1 and name != server2 or department in (hr, finance, engineering)|
|Or||OR||name != server1 and (name != server2 or department in (hr, finance, engineering))||AND normally takes precedence over OR, you can change this with parenthesis|