I need to create a datagroup with the relation in object (URI:VIP:POOL), this could help me to implement a dynamic iRule that, based on the HTTP REQUEST, redirects the traffic to a specific pool.
This is the starting point of the iRule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/def/ghi/account*" {
pool servers_8100
}
"/def/ghi/customer*" {
pool servers_8200
}
"/def/ghi/equipment*" {
pool servers_8300
}
"/def/ghi/order*" {
pool servers_8400
}
"/def/ghi/statement*" {
pool servers_8500
}
"/def/ghi/payment*" {
pool servers_8600
}
"/def/ghi/financials*" {
pool servers_8700
}
default {
pool servers_default_pool
}
}
}
Could you recommend to me a way for implementing both the datagroup and the iRule ?
HI Matteo, are you wanting to really redirect, or just to select the the appropriate pool? Can you give a sanitized example of the data-group goal, and how the client connects before/after the decision?
The function/goal of the DG is to provide a correlation between URI:VIP:POOL, in this way I can direct two equals URI to different VIP dinamically, this is a common scenario in my production environment.
The idea is that clients point to a specific VIP, based on URI the iRule invokes the DG (URI:VIP:POOL) and directs the traffic properly.
I’m not able to provide you an example because I haven’t try to do something like that.
Do you have a suggestion about the iRule composition and the DG key:value parameters?