The event
library provides functions for understanding an event and the environment in which it was raised. For historical reasons, some of these are Web-centric. The following functions are available:
event:env()
.event:env()
returns information about the event's environment. The function takes an argument that determines what will be returned:caller
. Causesevent:env()
to return the URL of the Web page on which the event is firing (assumes an event in theweb
domain)ip
. Causesevent:env()
to return the IP number of the endpoint (client).referer
. Causesevent:env()
to return the URL of the referring page to the caller (assumes a web event).title
. Causesevent:env()
to return the page title of the calling page.- txn_id. Causes
event:env()
to return the transaction ID of this ruleset evaluation.
event:attr()
.event:attr()
returns a specific event attribute. The function takes the name of the attribute to be returned as its sole argument.event:attrs()
.event:attrs()
returns all the event attributes as a map.