For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Aviv's avatar
Aviv
Icon for Cirrus rankCirrus
Jan 20, 2016

Combine ACCESS_POLICY_AGENT_EVENT and http_request

Hi!

How to Combine ACCESS_POLICY_AGENT_EVENT and http_request? i get error on this irule:

when ACCESS_POLICY_AGENT_EVENT {
    if { [ACCESS::policy agent_id] eq "irule_test" }{

     when HTTP_REQUEST {

        HTTP::header insert "case" [ACCESS::session data get "session.logon.last.username"]
        log local0. "case mumber is [ACCESS::session data get "session.logon.last.username"]"
        pool Pool_test
    }

    }
}

Thanks, Aviv Hassidim

6 Replies

  • Lucas_Thompson_'s avatar
    Lucas_Thompson_
    Historic F5 Account

    ACCESS_POLICY_AGENT_EVENT runs in the context of the connection between TMM and the renderer (the little web server that sends the logon pages, etc). Thus, it's not appropriate to set a pool in this context.

     

    If you want to set a pool for a session, use the "Pool Assign" action in the Access Policy.

     

    • Aviv's avatar
      Aviv
      Icon for Cirrus rankCirrus
      as u can see in the irule.. the line of pool is in comment. and i getting error. can i use when access_policy_agent_event together with when http_request?
    • Lucas_Thompson_'s avatar
      Lucas_Thompson_
      Historic F5 Account
      OK, yes I see you've put one event code block inside another event code block. Don't do that, it doesn't make sense. You need to define the event, then state the code that runs in it. An event doesn't run inside another event. What are you trying to accomplish?
    • Aviv's avatar
      Aviv
      Icon for Cirrus rankCirrus
      ן want to insert only once the user logon name in the header of specific web page. can u tell me how?
  • Thanks Lucas. Now i understand i have used this irule and it worked once as i need:

    when ACCESS_ACL_ALLOWED {
       set user [ACCESS::session data get "session.logon.last.username"]
       HTTP::header insert "X-USERNAME" $user
    }
    

    Thanks,

    Aviv Hassidim