ltm rule command POLICY targets
iRule(1) BIG-IP TMSH Manual iRule(1)
POLICY::targets
Returns or sets properties of the policy rule targets for the policies
associated with the virtual server that the iRule is enabled on.
SYNOPSIS
POLICY::targets ('ltm-policy' |
'http' |
'http-uri' |
'http-host' |
'http-header' |
'http-referer' |
'http-cookie' |
'http-set-cookie' |
'http-reply' |
'log' |
'pem' |
'cache' |
'compress' |
'decompress' |
'forward' |
'wam' |
'asm' |
'l7dos' |
'avr' |
'tcl' |
'request-adapt' |
'response-adapt' |
'tcp-nagle' |
'server-ssl' |
'persist')?
DESCRIPTION
Returns or sets properties of the policy rule targets for the policies
associated with the virtual server that the iRule is enabled on. A
policy rule target can be considered an action that the policy uses if
the rule conditions are met.
As of v11.4 the following policy targets are available:
wam - Application Acceleration Manager (AAM)
asm - Application Security Manager
log - Log
http-cookie - HTTP cookie
http-header - HTTP header
http-host - HTTP host header
http-referer - HTTP referer header
http-set-cookie - HTTP set-cookie header
http-uri - HTTP URI
tcl - Set a Tcl variable name and value
tcp-nagle - TCP Nagels algorithm As of v12.0
persist - Persistence mode
Syntax
POLICY::targets
* Returns a list of policy target(s) attached to the virtual server.
These are typically virtual server profiles or features which can
be enabled|disabled or modified per iRule execution via
policies.
POLICY::targets [ ltm-policy | http | http-uri | http-host | http-
header | http-referer | http-cookie | http-set-cookie | http-reply |
log | pem | cache | compress | decompress | forward | wam | asm | l7dos
| avr | tcl | request-adapt | response-adapt | tcp-nagle | server-ssl |
persist ]
* Returns 1 or 0 depending on whether the given target is used in the
selected policy
RETURN VALUE
VALID DURING
EXAMPLES
# Log the policy targets for this virtual server
when HTTP_REQUEST {
# Log the policy targets enabled on this virtual server
log local0. "\[POLICY::targets\]: [POLICY::targets]"
# Loop through each possible target type and log whether it is enabled or not (1 for enabled, 0 for not enabled)
foreach target {asm wam log http-cookie http-header http-host http-referer http-set-cookie http-uri log tcl tcp-nagle} {
log local0. "\[POLICY::targets $target\]: [POLICY::targets $target]"
}
}
# /var/log/ltm output:
: [POLICY::targets]: log forward server-ssl
: [POLICY::targets asm]: 0
: [POLICY::targets wam]: 0
: [POLICY::targets http-cookie]: 0
: [POLICY::targets http-header]: 0
: [POLICY::targets http-host]: 0
: [POLICY::targets http-referer]: 0
: [POLICY::targets http-set-cookie]: 0
: [POLICY::targets http-uri]: 0
: [POLICY::targets log]: 1
: [POLICY::targets tcl]: 0
: [POLICY::targets tcp-nagle]: 0
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-11.4.0 --First introduced the command. @BIGIP-12.0.0 --Added
POLICY::controls persistence --Added POLICY::targets persist
BIG-IP 2017-01-31 iRule(1)