Forum Discussion
Srinivasan_G_31
Nimbostratus
Oct 25, 2012iRule help
Hi,
I want an iRule which can match a specific URI on an incoming http request and redirect traffic to a specific pool member of a pool. Please help.
Srini
nitass
Employee
Oct 29, 2012[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [scan [HTTP::uri] {/%[^.]} f_name] == 1 } {
switch -regexp $f_name {
^[0-9]+$ { log local0. "URI is [HTTP::uri] | $f_name is number" }
default { log local0. "URI is [HTTP::uri] | $f_name is not number" }
}
}
}
}
[root@ve10:Active] config cat /var/log/ltm
Oct 29 21:26:01 local/ve10 err mcpd[3815]: 01020066:3: The requested rule (myrule) already exists in partition Common.
Oct 29 21:29:49 local/tmm info tmm[7926]: Rule myrule : URI is /1234.aspx | 1234 is number
Oct 29 21:29:57 local/tmm info tmm[7926]: Rule myrule : URI is /1234abcd.aspx | 1234abcd is not number
Oct 29 21:30:10 local/tmm info tmm[7926]: Rule myrule : URI is /xyz1234.aspx | xyz1234 is not number
Oct 29 21:30:14 local/tmm info tmm[7926]: Rule myrule : URI is /somethingelse | somethingelse is not number
this is another example we have discussed in the past.
how to match 6 digtals via command except matches_regex
https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aft/2158816/asg/54/Default.aspx
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