persist on x-forwarded-for

I am stuck on how to reference the value of the x-forwarded-for header. we want to persist on the original client-ip. SNAT and the persistence profile is causing an upstream pool with 2 members to load-balance to only 2 members of a downstream pool that contains 4 members. source address affinity appears to be getting in our way so i thought if i could persist on the original client-ip, that would solve the problem. Just not sure how to reference the IP contained in the XFF header. Can you point me in the right direction?

when CLIENT_ACCEPTED {

Set persistence based on client IP for 900 seconds

persist uie “[IP::client_addr]” 900

}

Hi,

If the XFF header is present with a value, you can use this:

when HTTP_REQUEST { 
    if {[HTTP::header X-Forwarded-For] != ""}{  
       persist uie [HTTP::header X-Forwarded-For] 900 
    } 
 }

Aaron