Forum Discussion
Sagen_80793
Mar 18, 2005Historic F5 Account
wlnode function
Is there a specific example of how to employ the "wlnode" function to allow for Weblogic persistence?
I am working to configure persistence via the JSESSIONID when cookie persistence is not available. I have built a rule that parses out the JSESSIONID from the HTTP_RESPONSE and enters that into the persistence table, but it appears there might be a simpler option.
Thanks,
Sagen
- Sagen_80793Historic F5 AccountHere is what I have developed so far as way to persist based on the issued JSESSIONID:
rule WeblogicJSessionPersist { when HTTP_RESPONSE { set key [HTTP::cookie "JSESSIONID"] set value [IP::server_addr]:[TCP::server_port] if {$key != ""} { log local0. "Adding jsess of: $key, value of: $value" session add uie $key $value set value2 [session lookup uie $key] log local0. "Re-looking up key: $key, provides value: $value2" } } when HTTP_REQUEST { set jsess [findstr [HTTP::uri] "jsessionid" 11 ;] log local0. "Entering REQUEST, jsess is: $jsess" if { $jsess != "" } { set server [session lookup uie $jsess] log local0. "Server IP is: $server" if { $server != "" } { pool Weblogic_HTTP_Pool member $server } } } }
- JRahm
Admin
I don't see that you're using value2, was this just for error checking while building the rule? - unRuleY_95363Historic F5 AccountThis is an interesting rule. The interesting aspect of it is that you have re-implemented persistence using the session table. Way to go.
rule WeblogicJSessionPersist { when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] } { persist add uie [HTTP::cookie "JSESSIONID"] } } when HTTP_REQUEST { set jsess [findstr [HTTP::uri] "jsessionid" 11 ";"] if { $jsess != "" } { persist uie $jsess } } }
- unRuleY_95363Historic F5 AccountOn another note, to be more complete, you may want to check for a client cookie and only use the uri query string if the cookie isn't present. Here is an update:
rule WeblogicJSessionPersist { when CLIENT_ACCEPTED { set add_persist 1 } when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] and $add_persist } { persist add uie [HTTP::cookie "JSESSIONID"] set add_persist 0 } } when HTTP_REQUEST { if { [HTTP::cookie exists "JSESSIONID"] } { persist uie [HTTP::cookie "JSESSIONID"] } else { set jsess [findstr [HTTP::uri] "jsessionid" 11 ";"] if { $jsess != "" } { persist uie $jsess } } } }
- JRahm
Admin
Does BigIP purge the persistence table of entries to servers that have been marked down, or would this validation need to be checked in the iRule before persisting? - unRuleY_95363Historic F5 AccountWell, sort of...
- JRahm
Admin
We are finally getting around to inserting bigip into the application tier between our web and app servers. We will be utilizing a similar rule to above, but I also need to replace and remove some headers. Is it better to include that in this rule, or attach another rule with that logic? Which logic should come first, or does it matter if the values being set are not the same within the HTTP_REQUEST event? - Leslie_South_55
Nimbostratus
I am trying to use a similar rule to persist to weblogic servers based on the jsession id; here is my rulewhen HTTP_RESPONSE { set key [HTTP::cookie "JSESSIONID"] set value [IP::server_addr]:[TCP::server_port] if {$key != ""} { log local0. "Adding jsess of: $key, value of: $value" session add uie $key $value set value2 [session lookup uie $key] log local0. "Re-looking up key: $key, provides value: $value2" } } when HTTP_REQUEST { set jsess [findstr [HTTP::uri] "jsessionid" 11 ;] log local0. "Entering REQUEST, jsess is: $jsess" if { $jsess != "" } { set server [session lookup uie $jsess] log local0. "Server IP is: $server" if { $server != "" } { pool pool_weblogic_pool_http member $server } } }
- Leslie_South_55
Nimbostratus
I have just been informed that we need to persist on anyone of about 5 cookies that come from the weblogic servers; I found out that the reason I was not persisting, was the client is presenting one of the other cookies on about the 4th HTTP GET request; I am searching this forum now for persisting on multiple cookies. If anyone knows how to do this I would appreciate the help. - Wes_98712
Nimbostratus
What would be really interesting is to figure out if the client browser doesn't accept the cookie, to write the JSessionID to the URL as part of the query string. There are folks that turn off cookies in their browser, so in this instance, how could we ensure they persist to the same SessionID but not in the browser, in the URL. You capture this in the HTTP_REQUEST portion of the code, where you set the jsess variable, which it looks for the ID in the URL, question is, how does it get there?
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