Forum Discussion
Michael_Mau_108
Nimbostratus
Jul 09, 2008Problem with I-rule that routes based on payload information
I have an i-rule that I am writing, to route requests to particular pool members based on information within a clients payload. The rule synxtax is below.
when HTTP_REQUEST {
if { [HTTP::header exists "Content-Length"] } {
set content_len [HTTP::header "Content-Length"]
} else {
set content_len 1000000000
}
if { $content_len > 0 } {
HTTP::collect $content_len
}
}
when HTTP_REQUEST_DATA {
if { ([matchclass [HTTP::payload] contains $::maui-qos])} {
if { [LB::status pool fbt-maui-sit-qa-8980-v-dcc member 10.86.33.80 8980] eq "down"
or
[LB::status pool fbt-maui-sit-qa-8980-v-dcc member 10.86.33.80 8980] eq "session_disabled"
} {
pool fbt-maui-sit-qa-8980-v-dcc
} else {
pool fbt-maui-sit-qa-8980-v-dcc member 10.86.33.80 8980
}
}
}
If a string in the payload matches a matchclass object, then I want them to go to one pool member (out of three); which I made a priority 7 (the other two are 10). If they do not match, then I want to send them to the pool, where they get load balanced between the two priority 10 pool members.
My problem seems to be with the matchclass command, because when I remove that line and point to a pool, I am routed as expected.
Does anyone have any ideas as to why my I-rule won't work; and know of another way to do this?
Thank you,
-Mike
- hoolio
Cirrostratus
Hi Mike, - Michael_Mau_108
Nimbostratus
That did the trick! It works just as expected now.
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