Forum Discussion

Raunak_Tiwari's avatar
Raunak_Tiwari
Icon for Nimbostratus rankNimbostratus
Aug 06, 2020
Solved

How to Create IRule to divert traffic between Pools based on XFF Header

Hello Everyone,   I am facing issue with my Irule, Natted Traffic is coming from Imperva WAF and i have take value Value of XFF Header to redirect traffic to specific pool.   I am receiving H...
  • Enes_Afsin_Al's avatar
    Aug 07, 2020

    Hi Raunak Tiwari,

    You should use "class match" for datagroup compare

    when HTTP_REQUEST {
    	if { [class match [HTTP::header "X-FORWARDED-FOR"] equals <DataGroupName>] } {
    		pool Federation-ACC-444
    	}
    	else {
    		pool Federation-ACC-443
    	}
    }

    https://clouddocs.f5.com/api/irules/class.html