Populate and manage the Thorium register.
Thorium formulas usually start here. The reg states collect fields from
matching events and store them in memory so later check, calc, or
action states can make decisions based on more than one event.
Clear the namespace from the register
USAGE:
clearns:
reg.clear:
- name: myregister
Delete the namespace from the register
USAGE:
deletens:
reg.delete:
- name: myregister
Add the specified values to the named list.
If stamp is True, then the timestamp from the event will also be added
if prune is set to an integer higher than 0, then only the last
prune values will be kept in the list.
Use this form when you want a recent history of matching events rather than a de-duplicated set.
USAGE:
foo:
reg.list:
- add: bar
- match: my/custom/event
- stamp: True
deploy_failures:
reg.list:
- add:
- id
- reason
- match: acme/deploy/failed
- stamp: True
- prune: 10
Accept a numeric value from the matched events and store a running average of the values in the given register. If the specified value is not numeric it will be skipped
USAGE:
foo:
reg.mean:
- add: data_field
- match: my/custom/event
Add a value to the named set.
Use this when you want a unique collection of values, such as the set of minion IDs or object names seen in matching events.
USAGE:
foo:
reg.set:
- add: bar
- match: my/custom/event
seen_minions:
reg.set:
- add: id
- match: acme/custom/event