Modes
Template picking modes — all, any, chance, spin, chain, and fsm.
The mode field determines how templates are selected for each incoming timestamp.
all
Every template is rendered for every timestamp. Produces N events per timestamp, where N is the number of templates.
event:
template:
mode: all
templates:
- access_log:
template: templates/access.jinja
- error_log:
template: templates/error.jinjaany
A single template is chosen at random (uniform distribution) for each timestamp.
event:
template:
mode: any
templates:
- success:
template: templates/success.jinja
- error:
template: templates/error.jinjachance
A single template is chosen at random with weighted probability. Each template has a chance value — the higher the value relative to others, the more likely it is to be selected.
| Extra parameter | Type | Constraints | Description |
|---|---|---|---|
chance | float | Required. > 0 | Relative probability weight. |
event:
template:
mode: chance
templates:
- success:
template: templates/success.jinja
chance: 90
- error:
template: templates/error.jinja
chance: 10spin
Templates are rendered in round-robin order. The first timestamp uses the first template, the second uses the second, and so on, cycling back to the first after the last.
event:
template:
mode: spin
templates:
- request:
template: templates/request.jinja
- response:
template: templates/response.jinjachain
Templates are rendered in a fixed order defined by the chain list. All templates in the chain are rendered for every timestamp, in the specified order.
| Extra parameter | Type | Constraints | Description |
|---|---|---|---|
chain | list of strings | Required. At least one alias. | Ordered list of template aliases to render. |
event:
template:
mode: chain
chain: [login, browse, checkout, logout]
templates:
- login:
template: templates/login.jinja
- browse:
template: templates/browse.jinja
- checkout:
template: templates/checkout.jinja
- logout:
template: templates/logout.jinjafsm
Templates represent states in a finite state machine. After each timestamp, the machine evaluates transition conditions to decide the next state. This enables stateful event sequences like user sessions or protocol flows.
How it works:
- The machine starts at the template marked
initial: true. - That template is rendered, producing an event. During rendering, the template can modify state variables (
locals,shared,globals). - After rendering, transitions are evaluated in order — the first transition whose
whencondition istruefires. - The machine moves to the state named in the
tofield. - On the next timestamp, the new current template is rendered and the cycle repeats.
- If no transition matches, the machine stays in the current state.
| Extra parameter | Type | Default | Constraints | Description |
|---|---|---|---|---|
initial | boolean | false | Exactly one template must be true. | Marks the starting state. |
transitions | list of transition configs | [] | — | Possible transitions from this state. |
event:
template:
mode: fsm
templates:
- idle:
template: templates/idle.jinja
initial: true
transitions:
- to: active
when:
gt:
shared.request_count: 0
- active:
template: templates/active.jinja
transitions:
- to: idle
when:
eq:
shared.request_count: 0For full details on FSM transitions, conditions, and examples, see FSM.