...
Code Block |
---|
rule hello_world { select when echo hello pre { name = event:attr("name").klog("our passed in name: ") } send_directive("say") with something = , {"something":"Hello " + name}) } |
This is the first use in these lessons of a prelude block within a rule. This is where we bind values to names which can then be used within the rule. Here, we obtain the value of the event attribute named "name" and bind that value to a name which is also named "name". We apply the "klog" operator to that value, which simply passes the value along, but as a side-effect logs its argument followed by the value.
...