avi.vs.table_lookup

DataScript

Function avi.vs.table_lookup( [table_name,] key [, lifetime_exten] )
Description The table API is used to store and retrieve custom data.
The avi.vs.table_lookup API looks up a key and return the corresponding value. This key-value store is unique for every virtual service and is mirrored across all service engines hosting the virtual service.
Events VS_DATASCRIPT_EVT_L4_REQUEST
VS_DATASCRIPT_EVT_L4_RESPONSE
Parameters If the optional table_name is not specified, the key is looked up in the default table for the virtual service. When it is specified, a custom table will be searched. The key is used to look up the value. The optional lifetime_exten flag must be a positive integer, indicating the length of time, in seconds, that should be added to the current lifetime parameter for the key. When not specified, the default value of 300 seconds is used. This means that by default, looking up the value of a key will extend the lifetime of a key by an additional 300 seconds. To lookup the key without impacting the expiration, set the lifetime_exten flag to 0.
Returns Returns the value of the looked up string. If the string is not valid, the value returned is nil.
Example

radius_username = “myuser”
if avi.vs.table_lookup(radius_username) then
   avi.vs.log(“Radius username ”..radius_username)
end