Forum Discussion

Jason_46811's avatar
Jason_46811
Icon for Nimbostratus rankNimbostratus
Oct 26, 2010

Akamai - Hash persistence based on true-client-IP

Hi,

 

 

i am a complete newbie to irules. I have the same requirement as Jeff to create a Hash persistence based on a custom inserted header true-client-IP as i am also using Akamai. This will have to work for both http and https traffic. I have tried to assemble the code as follows but i am receiving a syntax error of: line 1: [braces are required around the expression] [when HTTP_Request {

 

 

(http://devcentral-sea.f5.com/Forums...fault.aspx)

 

 

when HTTP_REQUEST {

 

if {[HTTP::header exists "True-Client-IP"]}{

 

set tcip_header [HTTP::header "True-Client-IP"]

 

} else { set tcip_header "1.1.1.1"

 

}

 

if {[active_members Onlinebrands_http_real_server]}{

 

if {[scan [lindex [active_members –list app_http_pool] [expr {[md5 $tcip_header] % [active_members app_http_pool]}]] {%s %s} ip port] == 2}{

 

pool app_http_pool member $ip $port

 

return

 

}

 

}

 

}

 

 

Thanks, Jason
  •  
     when HTTP_REQUEST {  
        if {[HTTP::header exists "True-Client-IP"]}{  
             set tcip_header [HTTP::header "True-Client-IP"] 
     } else { set tcip_header "1.1.1.1" } 
     if {[active_members Onlinebrands_http_real_server]}{  
        if {[scan [lindex [active_members –list app_http_pool] [expr {[md5 $tcip_header] % [active_members app_http_pool]}]] {%s %s} ip port] == 2}{  
          pool app_http_pool member $ip $port  
        return  
     } 
     } 
     }