LTM Policy Logging variables pre 12.0

Hi Guys,

Does anyone know if it is possible to log dynamic variables (e.g. [HTTP::uri]) within a LTM policy code pre 12.x (on v11.6.1)? I read the following from here

Version 11.X:

Request dropped : [HTTP::uri]

Version 12.X:

tcl:Request Dropped : [HTTP::uri]

However I am unable to get the dynamic variables to log correctly.

I am only able to set a condition on the dynamic variable (e.g. [HTTP::uri]) and then statically log. e.g.

ltm policy /Common/lab-test-policy-v1.1 {
    controls { forwarding }
    requires { http }
    rules {
        log {
            actions {
                0 {
                    log
                    write
                    message "LAB_HEADER: YES"
                }
            }
            conditions {
                0 {
                    http-header
                    name LAB_HEADER
                    values { YES }
                }
            }
            ordinal 1
        }
    }
    strategy /Common/first-match
}

Is that the best I can do until I upgrade to 12 code? Thanks in advance. Foss

Hi Guys,

It turns out dynamic variables are only available on v12.x and it is not possible on v11.x

Here is the excerpt form F5… The feature you are trying to use is called “TCL command substitution” and is supported only in v12.x

Manual Chapter: Local Traffic Policies
   https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-basics-12-0-0/7.html

In versions prior to v12.x you cannot use TCL variables in the log messages (only static text) - iRules have to be used to log TCL variables in this case.

In v12.x you can use the syntax below to log TCL variables such as "HTTP::uri":

 ltm policy /Common/Drafts/lab-test-policy-v1.1 {
    last-modified 2016-10-12:13:12:16
    published-copy /Common/lab-test-policy-v1.1
    requires { http }
    rules {
        log {
            actions {
                0 {
                    log
                    write
                    message "tcl: This is the current URI: [HTTP::uri]"
                }
            }
        }
    }
    strategy /Common/first-match
 }