Forum Discussion
iRule to read key/value pair from Data Group lists
So all you're looking for is to look up a custom header value in a Data Group and have that map to a pool member address. That's very doable. You'd want something like:
when HTTP_REQUEST {
if {[HTTP::header exists "myCustomHeader"]} {
set member [class match -value [HTTP::header "myCustomHeader"] equals myClassName]
if {$member ne ""} {
pool member $member 80
}
}
}
This would require a data group named myClassName that looks like you described above, sample1 with a value of 192.168.1.11, sample2 with a value of 192.168.1.12, etc. and it assumes the custom header is named "myCustomHeader" with the values of sample1, sample2, etc.
You can, of course, change any of the variable or data group names to be more to your liking.
Colin
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com