Forum Discussion
commsmonkey_172
Nimbostratus
Aug 08, 2010Persist uie with Findstr query
I've come across the following irule and I'm not sure exactly what it's intentions are
rule Persist_Universal {
when HTTP_REQUEST {
persist uie [ findstr [HTTP::uri] "?" 9 3 ]
}
}
To me based on findstr this matches nearly everything heading by this node, eg most urls are as per the following http://somesite.com/content.html?query123ADF90
Cheers,
Comms
7 Replies
- The_Bhattman
Nimbostratus
Hi Comms.
Basically it's persisting based on the URI of a URL - specifically a query. 9 indicates what is skipped and 3 is the terminator. You can also use [HTTP::query] instead of [HTTP::uri] to accomplish this
Bhattman - Colin_Walker_12Historic F5 AccountKeep in mind we have HTTP::query and URI::query for accessing just the query portion of a URI as well. These would allow you to skip the findstr portion.
Colin - yxshybj_101037
Nimbostratus
according above , does it mean : startwith "q" , then skips 9 characters to" A ", and use 3 characters " DF9 " to persist session ? thank you ! - nitass
Employee
e.g.[root@ve10:Active] config b rule myrule list rule myrule { when RULE_INIT { set uri "/content.html?query123ADF90" log local0. "\[findstr $uri ? 9 3\] is [findstr $uri ? 9 3]" } } [root@ve10:Active] config tail /var/log/ltm Sep 3 17:51:53 local/tmm info tmm[4925]: Rule myrule : [findstr /content.html?query123ADF90 ? 9 3] is ADF - nathe
Cirrocumulus
yxshybj
For http://somesite.com/content.html?query123ADF90 the persistence record (I believe) will be simply AD
My logic: find ? in the URI, skip 9 chars to after the 3 and return the sub-string from there to the end, minus the terminator of length 3. So this is AD
I'm sure if I'm wrong the most excellent community will correct me.
Hope this helps.
N - nathe
Cirrocumulus
Thanks nitass - looks like I was wrong. I did wonder if I should get on my test box to check...hence the delay in clicking on Submit and missing your post.
N - yxshybj_101037
Nimbostratus
hi,
thanks very much .may i understand below : when skip 9 chars , it include the "?" ,so it start with the "?" , and end with "3"-------so the 9 chars are "?query123", and then use the after 3 chars "ADF" to persist the session, does this true ? thank you !
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
