Variables¶
DepC allows you to declare a variable that can be reused in your indicator parameters.
A variable can be of the following types :
- a string
- a text
- a number
You can create it in the Variables menu within your team, for example :
Warning
Checks are renamed Indicators. But the variable namespace prefix
remains depc.check.
for now.
Here we declare a variable in the Indicator level : it means
{{ depc.check.location }}
will be replaced by the FR2 value
in all uses.
Levels¶
To be as flexible as possible, DepC supports 4 levels of variables :
- Team :
{{ depc.team.myTeamVar }}
- Rule :
{{ depc.rule.myRuleVar }}
- Source :
{{ depc.source.mySourceVar }}
- Indicator (previously Check) :
{{ depc.check.myIndicatorVar }}
Builtins Variables¶
By default 3 builtins variables are available :
- Name :
{{ depc.name }}
- Start:
{{ depc.start }}
- End:
{{ depc.end }}
These variables represent the 3 arguments sent to every indicators when launching a rule :
Jinja2 Templating¶
After declaring it, you can reuse your variables with the
Jinja2 syntax (calling the variables
can be done within the {{ ... }}
delimiters).
Note
You can use the iso8601 filter after your
timestamp variables : it will convert the timestamp into its iso8601
value ({{ depc.start | iso8601 }}
).
You can also use the Jinja2 conditions. For example your can filter your timeseries by tags if the name was sent during the rule execution :