var - retrieve the value of a variable set on the page (see Page Variables for more information)
env - retrieve the value of the page environment
url - retrieve the values for components of the calling page's URL.
The argument to each of these functions is the page or environement variable name as a string.
page:env
The following arguments are valid for page:env:
caller - the URL of the page on which the ruleset if evaluating
ip - IP number of the client
referer - the URL of the refering page to the caller
rid - the ruleset ID
rule_version - version number of the ruleset. Note that these are monotonic, but not sequential.
title - the page title of the calling page
txn_id - the transaction ID of this ruleset evaluation
page:url
The following arguments are valid for page:url:
protocol - the protocol scheme (e.g. http, https, etc.)
hostname - the complete hostname (e.g. www.windley.com)
domain - the domain portion of the hostname (e.g. windley.com)
tld - the top-level domain of the hostname (e.g. com, org, net, etc.)
port - the port (defaults to 80 if unspecified)
path - the path portion of the URL (e.g. /archives/2008/07)
query - the query string, if present (e.g. ?vxx=_ADJKLD&q=foo)
The declarations
h = page:url("hostname");
d = page:url("domain");
q = page:url("query");
executed as a result of a call from a page with the url http://www.windley.com/archives/2008/07?q=foo would result in h having the value www.windley.com, d having the value windley.com, and q having the value q=foo.
page:param
page:param takes a single argument: the name of the parameter. It returns the value of that parameter. Page parameters are set in the KNS_config object by the endpoint.
So, if the KNS_config object contained the following:
Page
The <source> for page data sources is page.
The following functions are available:
The argument to each of these functions is the page or environement variable name as a string.
page:env
The following arguments are valid for page:env:
page:url
The following arguments are valid for page:url:
The declarations
h = page:url("hostname"); d = page:url("domain"); q = page:url("query");executed as a result of a call from a page with the url
http://www.windley.com/archives/2008/07?q=foowould result inhhaving the valuewww.windley.com,dhaving the valuewindley.com, andqhaving the valueq=foo.page:param
page:param takes a single argument: the name of the parameter. It returns the value of that parameter. Page parameters are set in the
KNS_configobject by the endpoint.So, if the
KNS_configobject contained the following:var KOBJ_config ={ "rids" : ["ruleset_1","ruleset_2"], "ruleset_1:ex1" : "3", "ruleset_2:ex2" : "5", };then the following declaration
n = page:param("ex1")would result in
nhaving the value of 3.