Forum Discussion
Irule to match on Parameter value
i have Parameter named "User-Info" inside HTTP POST Request i want to check & if value = XX , send to Pool-1 , if not send to Pool-2
7 Replies
- Telnet_178675
Nimbostratus
i have Parameter named "User-Info" inside HTTP POST Request i want to check & if value of this parameter = XX , send to Pool-1 , if not send to Pool-2
Add Comment
- Brad_Parker_139
Nacreous
If it is a query parameter you can do it with something like this:
when HTTP_REQUEST { if {[string tolower [URI::query [HTTP::uri] "User_Info"]] equals "xx"}{ pool "pool-1" } else { pool "pool-2" } }- Brad_Parker_139
Nacreous
If your POST body is XML you could use a XML profile to direct your traffic to a pool based on that value. https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-implementations-11-6-0/3.html If its some other kind of body you may have to get more creative and parse the HTTP payload using HTTP::collect, https://clouddocs.f5.com/api/irules/HTTP__collect.html, and the HTTP_REQUEST_DATA event.
- Brad_Parker
Cirrus
If it is a query parameter you can do it with something like this:
when HTTP_REQUEST { if {[string tolower [URI::query [HTTP::uri] "User_Info"]] equals "xx"}{ pool "pool-1" } else { pool "pool-2" } }- Brad_Parker
Cirrus
If your POST body is XML you could use a XML profile to direct your traffic to a pool based on that value. https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-implementations-11-6-0/3.html If its some other kind of body you may have to get more creative and parse the HTTP payload using HTTP::collect, https://devcentral.f5.com/Wiki/iRules.HTTP__collect.ashx, and the HTTP_REQUEST_DATA event.
- Telnet_178675
Nimbostratus
what if Parameter is not inside URI Query ?
- Telnet_178675
Nimbostratus
what if Parameter is not inside URI Query ?
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