variable in different event of Irule
I'm working on an irule i'm trying to save the XFF Header data to a variable in the Irule Event HTTP_REQUEST and use the same variable in Irule Event ACCESS_POLICY_AGENT_EVENT But i'm getting an error stating variable is not available.
Next I tried to use the XFF header directly in the APM event but when i log the Header data i'm not able to view the XFF header of the original client it get's stiffed off and i'm seeing 127.0.0.X ip in the logs so i need help in how can i use the Original Client IP in the XFF header to perform decision on APM
Hi
Have you tried storing the xxf header as an APM variable right at the start when then policy first fires....?
when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ set xff [HTTP::header values X-Forwarded-For] } } when ACCESS_SESSION_STARTED { if {[info exists xff]}{ ACCESS::session data set session.custom.xff $xff } }
If the value is saved as an APM variable then you should be able to manipulate it (or take action if it is empty) further on in the APM policy