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 will gofor Header "TEST2" and if met it will execute that.
Out of my 100 requests i get 99 requests to "Header = TEST2" condition. But i need to check the first request in the same order (First Cookie ABCD and next Header TEST2). Once i am TRUE in Second loop Header = TEST2, all my corresponding requests should not go and check for HTTP Cookie ABCD. This is causing a lot of CPU Consumption.
I cant split the irule due to the architecture issues. Can anyone help in setting the FLAG that if i my request lands in HTTP Header = TEST2 then my next requests for this user login should not execute the HTTP Cookie "ABCD".
when HTTP_REQUEST {
if {([HTTP::cookie "TEST"] ne "") } {
pool p_pool1
}
elseif { [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
}
}
}
Anyones help is greatly appreciated
- Hamish
Cirrocumulus
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 } } } }
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