Forum Discussion
Joerg_Pavel_466
Nimbostratus
Jun 16, 2005Problem with map class to node
Hi,
we are having very strange behaviour on one of client sides with an iRule which should map client on specific nodes in a class.
In my opinion the following iRule should meet the needed criteria and should work:
when HTTP_REQUEST {
if {[HTTP::cookie exists "JSESSIONID"]} {
node [findclass [substr [HTTP::cookie "JSESSIONID"] 0 1] $::internet_resinwww_10445 " "]
}
}
In this rule BigIP should look for a cookie named “JSESSIONID” in the http header. If the value in the cookie contains the letter “a”, “b”, “c” or “d” BigIP should map that client to a specific server in the node class “internet_resinwww_10445”.
But the rule above doesn´t work at all. It ignores the findclass expression and the client request is load balanced instead of being persist on a server.
We tried then some other rules.
The following rule worked fine:
when HTTP_REQUEST {
if {[HTTP::cookie exists "JSESSIONID"]} {
node [getfield [findclass [substr [HTTP::cookie "JSESSIONID"] 0 1] $::internet_resinwww_10445] " " 2]
node [findclass [substr [HTTP::cookie "JSESSIONID"] 0 1] $::internet_resinwww_10445 " "]
}
}
So we just put the “getfield” expression in front of the “findclass” expression and it works.
This one also works:
when HTTP_REQUEST {
if {[HTTP::cookie exists "JSESSIONID"]} {
log [substr [HTTP::cookie "JSESSIONID"] 0 1]
node [findclass [substr [HTTP::cookie "JSESSIONID"] 0 1] $::internet_resinwww_10445 " "]
}
}
So we just put the “log” statement instead of the “getfield” expression in front of the “findclass” expression and it works.
Also this rule works where we put some log statements in:
when HTTP_REQUEST {
if {[HTTP::cookie exists "JSESSIONID"]} {
node [findclass [substr [HTTP::cookie "JSESSIONID"] 0 1] $::internet_resinwww_10445 " "]
log anfang
log [findclass [substr [HTTP::cookie "JSESSIONID"] 0 1] $::internet_resinwww_10445 " "]
set serverchar [substr [HTTP::cookie "JSESSIONID"] 0 1]
log [findclass $serverchar $::internet_resinwww_10445 " "]
log [HTTP::cookie "JSESSIONID"]
log [substr [HTTP::cookie "JSESSIONID"] 0 1]
log ende
pool netbank-banking member [findclass $serverchar $::internet_resinwww_10445 " "]
}
}
But as soon as we removed all log statements and the line the rule didn´t work at all.
The problem here is that we have to put “some” statements or other expressions in front of our expression
node [findclass [substr [HTTP::cookie "JSESSIONID"] 0 1] $::internet_resinwww_10445 " "]
to make that thing working as we expected.
I am not an iRule guru but this behaviour makes it hard to create other rules because it is a kind of an experimental thing to make them running.
Can you tell me the reason for that behaviour?
Did you ever see such a behaviour?
We are using version 9.1 on a BigIP 2400.
Thanks in advance for your help.
Regards
Joerg
4 Replies
Sort By
- unRuleY_95363Historic F5 AccountThis is very strange behavior indeed. And, no, we have not seen this behavior before.
- Joerg_Pavel_466
Nimbostratus
Hi, - unRuleY_95363Historic F5 AccountJoerg,
virtual vs_proxy_XXX_443 { destination a.b.c.d:443 ip protocol tcp profile pool_insert_client_ip proxy_clientssl_www_netbank-money_de proxy_serverssl_www_netbank-money_de tcp persist pool_persist_simple pool netbank-banking rule rule_vs_proxy_insert_cipher pool_select_node_netbank-banking vlans AZI WHZ WSZ disable }
- Joerg_Pavel_466
Nimbostratus
Hi,
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