The topology in StackState is likely much bigger than what you care about at any given time. StackState allows you to filter the topology to locate the part of the topology you are interested in.
If you want full control over your topology selection, you can use advanced topology selection. Advanced topology selection is used via the advanced filter bar, accessed by selecting Advanced on the basic filter panel. The advanced filter bar allows you to select topology using StackState’s built-in query language.
StackState Query Language (STQL) has the following core concepts:
Function always have an output type and can have have one or more arguments.
withNeighborsOf(components = (name = "myApp")).
List of functions:
|components||Set<Component>||Selection of components|
|withNeighborsOf||Set<Component>||select the neighbors of (specific) components|
|withCauseOf||Set<Component>||select the (root) cause and (optional) the path to this for (specific) components.|
STQL is a language which will defer execution till the moment the data is needed.
STQL is a Typed language, this means that all functions have typed input parameters and output. Not all functions work with all types. Types in STQL are inferred where possible. The following types are available:
The boolean operators are by default executed in the following order: First
OR and as of last rule
AND if you want to change the order you can use query blocks
AND If you want to have a rule that combines two basic filters in one rule you can use AND.
AND will combine the LEFT and RIGHT basic filters as one result. Example:
layer = "application" AND healthstate = "CRITICAL"
OR If you want to have a rule that combines the output of two basic filters in a query you can use OR.
OR will combine the LEFT and RIGHT basic filters as one result. Example:
layer = "application" AND healthstate = "CRITICAL"
NOT This rule subtracts all the results matching the right-hand side from the left-hand side. Example:
NOT (name = "AppA" OR name = "AppB"). This example will select all components except the ones with the name “AppA” or “AppB”.
If you want to combine multiple boolean operators
AND combinations and control the order, you can use
( ... ) to do this. Example:
(name = "AppA" OR name = "AppB") AND layer = "Application". Now the
name = "AppA" OR name = "AppB" is executed first, and both will be checked for the layer = “Application”. Without the code block only “AppB” will be checked for the layer = “Application” because the default order is
AND and as of last rule
A functions can have one ore more parameters. Parameters can be named and are typed. For example
withNeighborsOf(components = (name = "DLL_DB"), levels = "10", direction = "both")
components function is the implicit function used to select components based on a filter with support for key/value pair selection. All key-value pair filters added are implicitly filtering properties of components in your topology.
The key can be any key from the key/value pairs which you can put on a component. Or the following special keys:
name, The name of the component
healthstate, The own healthstate of the component
label, Matching label(s) of the component
layer, Matching layers of the component
domain, Matching layers of the component
environment, Matching layers of the component
The basic filter operators are:
The default behavior of a key-value filter is that it filters on properties of components:
name = "AppA"
name = "AppA" OR healthstate = "CRITICAL"
In other words: * basic
layer = "application" * name based selection
name in ("ApplicationA", "ApplicationB")
The withNeighborsOf function is used to append the ouput of the stream with neighbouring components.
direction=(optional, default=both) <direction> The direction can be
up for components which depend on this component and
down for dependencies.
both can be used for the combination of
levels is the number of levels you want to repeat this function. Use
all to continue till there are no more levels. This is limited to 15.
components=(optional, default=all components in input)<set-of-components> The component for which the neighbours should be returned
The withCauseOf function is used to append the output with the cause of a healthstate.
causeOnly=(optional, default=false)<boolean> to select only the cause itself select
true otherwise select
false to also select all components on the path to the cause.
components=<set-of-components> The component(s) for which the cause should be returned
name = "serviceB"
layer = "application"
applicationlayer that have either healthstate
DEVIATING. Also include components with names
appBand their neighbors:
layer = "application" AND (healthstate = "CRITICAL" OR healthstate = "DEVIATING") OR withNeighborsOf(components = (name IN ("appA","appB")))
applicationlayer that have a healthstate other than
CRITICAL. Also include components with names
service B. Also include the neighbors of component
layer = "application" AND healthstate != "CRITICAL" OR (name in ("serviceA", "serviceB")) OR withNeighborsOf(components = (name = "AppA"), levels = "2")
If you (start to)type a word at the beginning of a new code block (after the beginning of the line or after an
If you are at the end of a key
If you (start to)type a word after a basic filter operator