Forum Discussion

Blue_whale's avatar
Blue_whale
Icon for Cirrocumulus rankCirrocumulus
Dec 14, 2021

Irule to redirecting to pool based on User-Agent

Hi Team ,

 

We have a 443 VIP with default pool configured to it , We have a new requirement to create a new pool and redirect the traffic to the new pool based on the user-agent .

 

VIP : vs_example_443

Default Pool : p_example_80

 

New Pool : p_example_useragent_80

 

So if the http header contains user agent "example useragent 2.1" the traffic should be forwarded to pool p_example_useragent_80 else to the default pool p_example_80 ?

 

Can you please help me with the irule for this .

 

  • Hi ck_Bengre,

    when HTTP_REQUEST {
    	if { [HTTP::header User-Agent] contains "example useragent 2.1" } {
    		pool p_example_useragent_80
    	}
    	else {
    		pool p_example_80 
    	}
    }