Forum Discussion
Kalyan_Reddy_Da
Nimbostratus
Jul 28, 2010Help required in Irules for setting the FLAG
Hi Friends,
Need some help in the below irule. I have a irule whihc will cookie "ABCD" and if present some statements are executed which are CPU consuming and if condition is not met then it...
Hamish
Cirrocumulus
Jul 29, 2010On a connection basis it's easy...
when CLIENT_ACCEPTED {
set testflag 1
}
when HTTP_REQUEST {
if {([HTTP::cookie "TEST"] ne "") } {
pool p_pool1
} elseif { $testflag equals 1 } {
if { [HTTP::cookie "ABCD"] contains "app1l" } {
if { ([HTTP::uri] starts_with "/apps/admin/") } {
Execute some statements. whihc are very much CPU consuming.
} elseif {[HTTP::header "TEST2"] ne "" } {
Execute some statements.
pool p_pool2
set testflag 0
}
}
}
}
However if you want this by USER instead, then instead of using a hard-coded variable per connection (testflag), write the testflag to a session cookie and pull the value (Or if you have a cookie with the username in it, you could keep a table of users and their flags, but that assumes each user will only ever get the processing done once for all their parallel logins... That may be what you want, or not).
YMMV...
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