IRUle for Redirect and Keepalive

I’m looking for example of something that will allow us to add URI to Class and use class in the Irule to redirect to different pools and different keep alive files for monitor. we will have thousand of those pools, so creating something reusable, i just not sure if Monitor with variable keepalive file taken from the class even possible. any ideas?

Example.

URL: Example.com/poolA/mypath GOT TO POOL A

Use Monitor file Example.com/poolA/mypath/keepalive.html

URL: Example.com/poolB/mypath GOT TO POOL B

Use Monitor file Example.com/poolB/mypath/keepalive.html

URL: Example.com/poolC/mypath GOT TO POOL C

Use Monitor file Example.com/poolC/mypath/keepalive.html

VIP. 10.10.10.10

Pool A: IPs 192.168.1.2 and 192.168.1.3

Pool B IPs 192.168.1.3 and192.168.1.4 and 192.168.1.5

Pool C IPs 192.168.1.6 and 192.168.1.7

Hi alinayesina,

You could use a data group to store the URI to pool name mappings and then use class match to do the lookup:

There isn’t a way to programmatically perform monitoring based on the pool name though. If you need to have a distinct monitor send string per pool, you’d need to create a separate monitor per pool with the URI statically set in the monitor.

Aaron