Runbox.Scenario.OutputAction.Event (runbox v9.0.0)
Parameters for output action Event.
The resulting output action creates an event.
Link to this section Summary
Link to this section Types
Link to this type
actor()
Link to this type
actors()
@type t() :: %Runbox.Scenario.OutputAction.Event{ actors: actors(), origin_messages: [Toolbox.Message.origin()], params: %{required(String.t()) => String.t()}, template: String.t(), type: String.t() | atom() }
Event
:type
- type of the event. It's declared in Scenario's Manifest.:template
- event's template that allows to interpolate actors and parameters (see the Interpolation section below).:actors
- map of actors that are to be linked with the event. They may also be interpolated in the template.:params
- map of template parameters that are interpolated in the template (optional, defaults to%{}
).:origin_messages
- list of references to raw messages linked with the event itself (optional, defaults to[]
).
interpolation
Interpolation
The template may reference actors using placeholders like ${actors.actor_key}
, where
actor_key
corresponds to a key in the actors
map within this struct. In the UI,
these placeholders are transformed into links. Each link points to the corresponding
asset and displays the asset's name as the link text.
The template may also contain placeholders like ${params.param_key}
, where param_key
is a key under the params
map. These placeholders are simply replaced with the
corresponding values from the params
map. These parameters are useful for dynamic
content other than actors.
example
Example
%Event{
type: "server_login",
template: "${actors.person} logged into ${actors.server} using OpenSSH ${params.openssh_version}",
actors: %{
"person" => %{
asset_type: "/assets/person",
asset_id: "joe"
},
"server" => %{
asset_type: "/assets/server",
asset_id: "192.168.142.18"
}
},
params: %{"openssh_version" => "9.8"},
origin_messages: [normalized_message.origin]
}