Forum Discussion
Aug 17, 2013
irule class match each query param separately
Data Group dg1
param1=p11¶m2=p21 := host1
param1=p12¶m2=p22 := host2
The problem is that some request urls might list their query params in reverse order param2=p21¶m1=p11
Th...
Kevin_Stewart
Employee
Aug 17, 2013I think it would almost make more sense to just reorder the params, and then look them up in the data group. So something like this:
when HTTP_REQUEST {
if { [URI::query [HTTP::uri]] ne "" } {
set param1 [URI::query "?[URI::query [HTTP::uri]]" param1]
set param2 [URI::query "?[URI::query [HTTP::uri]]" param2]
set param3 [URI::query "?[URI::query [HTTP::uri]]" param3]
set paramstring "param1=$param1¶m2=$param2¶m3=$param3"
if { [class match $paramstring equals dg1] } {
... do something here ...
}
}
}
You'll of course need some additional error checking in there, to make sure params exist, but you get the idea.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects