POLICY::names

Description

iRule command which returns details about the LTM policy names for the virtual server the iRule is enabled on.

Syntax

POLICY::names [active | matched | unmatched]

POLICY::names active

  • Returns list of LTM policy name(s) attached to the virtual server

POLICY::names matched

  • Returns a list of LTM policy name(s) that had policy rules executed

POLICY::names unmatched

  • Returns a list of LTM policy name(s) attached to the virtual server that had no policy rules executed

Examples

# Log the policy names for this virtual server
when HTTP_REQUEST {
    log local0. "Enabled on this VS: \[POLICY::names active\]: [POLICY::names active]"
    log local0. "Matched: \[POLICY::names matched\]: [POLICY::names matched]"
    log local0. "Not matched: \[POLICY::names unmatched\]: [POLICY::names unmatched]"
}

# /var/log/ltm output:
<HTTP_REQUEST>: Enabled on this VS: [POLICY::names active]: /Common/uri_to_pool_policy /Common/serverssl_policy /Common/unmatched_policy
<HTTP_REQUEST>: Matched: [POLICY::names matched]: /Common/serverssl_policy /Common/uri_to_pool_policy
<HTTP_REQUEST>: Not matched: [POLICY::names unmatched]: /Common/unmatched_policy