evtctxsetvar()
Sets the user variable in the event context associated with the key. It returns false
if the event context does not exist or the result of evaluating the variable name expression is null
, and returns true
if the variable setting is successful.
Syntax
evtctxsetvar(TOPIC, KEY, VARIABLE, VALUE)
TOPIC
- Topic of the event context.
KEY
- Unique key that distinguishes the event context
VARIABLE
- User variable
VALUE
- Expression that returns the value to be assigned to a variable
Usage
Use the sessionkey field value as the identifier of the web_session
context and set the client_ip
variable as an ip field value.
evtctxsetvar("web_session", sessionkey, "client_ip", ip)