Forum Discussion
Eric_Waite_1046
Jan 08, 2007Nimbostratus
findstr
What does the following mean exactly?
set jsess [findstr [HTTP::uri] "jsessionid" 11 "?"]
What would it set the jsess variable in the following request?
http://users.readingplus.com/readingplus/loginSchool.do;jsessionid=F8E2C6F9B4CB4FA10EB277639AD77E96
I am confused with the syntax of findstr.
Thanks in advance
-Eric
- hooleylistCirrostratusHi Eric,
when RULE_INIT { set uri "/readingplus/loginSchool.do;jsessionid=F8E2C6F9B4CB4FA10EB277639AD77E96" set jsess [findstr $uri "jsessionid" 11 "?"] log local0. "\$jsess: $jsess" }
- Eric_Waite_1046NimbostratusThanks for you help, my problem stems from the following iRule that I am using for persistence. On some of my requests the persistence is not holding and its going to another server in the pool. I am at a loss.
- JRahmAdminI could never get a 100% solution with only the persist command. Probably my flawed coding, but rather than spin my wheels I switched to the session flavor of persistence so I could store the serverIP. If I get a match, I send the connection directly to the pool member serverIP stored in the session table:
when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] } { set trimID [lindex [split [HTTP::cookie "JSESSIONID"] "!" ] 0 ] if { [session lookup uie $trimID] equals "" } { session add uie $trimID [IP::server_addr] 1800 } } } when HTTP_REQUEST { if { [findstr [HTTP::uri] "jsessionid" 11 "!"] != ""} { pool MyPool member [session lookup uie [findstr [HTTP::uri] "jsessionid" 11 "!"] ] } else { pool MyPool } }
- Eric_Waite_1046NimbostratusI am now using the following and the persistenc edoes not allways hold, its almost as if the table is removing the entry on BIG_IP.
- JRahmAdminI trim at the ! so I only get the session ID. If you trim at the ? you also get the unique weblogic server identifiers, which I have noticed occasionally change.
when CLIENT_ACCEPTED { set get_server_mappings 1 } when HTTP_REQUEST { if { $get_server_mappings } { HTTP::header insert "X-Weblogic-Request-ClusterInfo" "true" set get_server_mappings 0 } }
when HTTP_RESPONSE { if { [HTTP::header exists "X-WebLogic-Cluster-List"] }{ set server_mappings [split [HTTP::header "X-WebLogic-Cluster-List"] "|" ] Remove header before returning to client HTTP::header remove "X-WebLogic-Cluster-List" } }
- Eric_Waite_1046NimbostratusThanks for the reply.
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