Forum Discussion

  • I think your best bet is to set

    [HTTP::uri]
    to a variable in the
    HTTP_REQUEST
    event, and then reference the variable in the
    ACCESS_POLICY_AGENT_EVENT
    event. That may work for you.

  • John_Alam_45640's avatar
    John_Alam_45640
    Historic F5 Account

    Variables are not shared between HTTP events and ACCESS events.

    The original landing uri is saved as a session variable,

    session.server.landinguri

    So from any APM event you can use

    [ACCESS::session data get session.server.landinguri]
    you will get the original URI. Since the policy runs at the start of a connection, this variable is probably what you are looking for.

    Having said that, he best way to pass the value of a variable between APM and LTM events is to stuff it into the APM policy session variable data structure.

    when CLIENT_ACCEPTED {
        ACCESS::restrict_irule_events disable
    }
    when HTTP_REQUEST {
       ACCESS::session data set session.http_uri [HTTP::uri]
    }
    when ACCESS_POLICY_AGENT_EVENT {
        if { [ACCESS::policy agent_id] eq "do_it_now_or_never" } {
            set uri [ACCESS::session data get session.http_uri]
        }
    }
    

    HTH.

    • John_Alam_45640's avatar
      John_Alam_45640
      Historic F5 Account
      I should clarify some things: The string "do_it_now_or_never" is a label you enter in the VPE to identify the location within the flow chart where you called the iRule Event from. This is yours to define. Stuffing and retrieving a value is session variables data structure is done via the commands: "ACCESS::session data set" and "ACCESS::session data get".