Skip to content

Stat Rule

You can pre-process data received from sensors before displaying it in the Data Table. To do this, you can set entity's stat rule with Set Object Stat Rules and Set Link Stat Rules

Stat rules is a set of actions that modify the data received in the monitoring process under certain conditions. See the Data forming rules section on the SAYMON wiki for more information.

Stat Rule Model

Field Type Description
conditions Array Conditions under which actions are applied to the data. If conditions aren't set, actions will be performed each time the server receives data.
actions Array Actions applied to the data.

Conditions

Field Type Description
_field Object The stat rule condition.
_field.name String The name of the metric that will be tested.
_field.value Object The metric value, which the current value is compared with, and a comparison operator. See the Value section for more information.

Value

Format of the value field:

"operator": "value"

Supported operators:

Field Description
_ct Contains
_eq Equal to
_gt Greater than
_gte Greater than or equal to
_lt Less than
_lte Less than or equal to
_m Matches with
_nct Not contains
_neq Not equal to

Actions

Action structure depends on the type of the action.

Field Type Description
type String The type of action. Possible values are set, extend and drop.
field String Name of the metric which the value should be written into. If there is no metric with that name, the metric will be added to the Data table.
value String Value which will be written into the metric. See the Value section for more information.

Value

Value can be:

  • numeric values, for example, 10
  • text data, for example, "text"
  • values of other metrics from the data table with the pointers current and new, for example, "{{new.temperature}}"
  • formulas using metrics from the data table with the pointers current and new, for example, "{{current.temperature}} - {{new.temperature}}"