Forum Discussion
6 Replies
Sort By
- spark_86682Historic F5 AccountYou could do something close with just a TCP profile. Something like:
when CLIENT_ACCEPTED { TCP::collect } when CLIENT_DATA { set idx [string first " HTTP/1." [TCP::payload]] if { $idx < 0 } { if { [TCP::payload length] > 2048 } { log local0. "ERROR! Could not find HTTP request in 2K! dropping..." reject } else { Not enough data yet; collect more TCP::collect } return } set request [string tolower [TCP::payload $idx]] if { $request contains " /XXXXX" } { pool Pool_XXXXX } else { pool Pool_WWWWW } }
- yaoxu_11146Nimbostratusunfortunately, after i applied this iRule to our site, the whole site is not accessible. I checked the iRule line by line, but failed to figure out while line blocked the access.
- Nicolas_MenantEmployeeYou may need a TCP::release at the end of the iRule
- yaoxu_11146Nimbostratusthanks for nmenant's reply, after adding 'tcp::release', users CAN be guided to the default pool pool_WWWWW, but the redirection to pool_XXXXX doesn't work, sorry i'm new to iRule, and can't figure out why...anybody could give me a hand?
- Andy_Herrman_22NimbostratusTry throwing some logging in place:
when CLIENT_ACCEPTED { TCP::collect } when CLIENT_DATA { set idx [string first " HTTP/1." [TCP::payload]] if { $idx < 0 } { if { [TCP::payload length] > 2048 } { log local0. "ERROR! Could not find HTTP request in 2K! dropping..." reject } else { Not enough data yet; collect more TCP::collect } return } set request [string tolower [TCP::payload $idx]] log local0. "Got request: $request" if { $request contains " /XXXXX" } { log local0. "Sending to Pool_XXXXX" pool Pool_XXXXX } else { log local0. "Sending to Pool_WWWWW" pool Pool_WWWWW } }
- Nicolas_MenantEmployeethe logging will be in /var/log/ltm.