Forum Discussion
ramesh_110176
Nimbostratus
Jan 08, 2009Need a Simple iRule
HI
I am new to iRules and have a need to check the content of a cookied, if it matches then I need to send to a pool if not re-direct it to a sorry page. Below is what I have:
when HTTP_REQUEST {
if { [HTTP::cookie contains "abcdefgh"] }
{
pool test
}
else { [HTTP::redirect http:\\sorry.x.y]}
}
I have also tried using HTTP_RESPONSE, the F5 takes the rule but in the statistics it fails each time its used.
Thanks for all your help.
- jay_41157
Nimbostratus
add this line and watch the logs... - ramesh_110176
Nimbostratus
Hi - James_Quinby_46Historic F5 AccountRamesh -
when HTTP_REQUEST { log local0. "check for [HTTP::cookie contains]" if { [HTTP::cookie contains "abcdefgh"] } { pool test } else { [HTTP::redirect http:\\sorry.x.y]} }
- ramesh_110176
Nimbostratus
I am not sure of the name but we can give it a value, I am in the process of finding this out. So once I put this line, how do I check whats going on? Is there a command line command I can type to see the data? - ramesh_110176
Nimbostratus
Thanks for all your help, after much work I have created what I needed:
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