Forum Discussion
andreast_4666
Nimbostratus
Oct 11, 2011Universal Persistence
Hi,
I have been reading through the LTM Advance course book and have come up to universal persistence but am having trouble understanding an option in the example in the book:
when HTTP_REQUEST { persist uie [findstr [HTTP::uri] "user=" 5 "&"] }
Im trying to understand what the '5' in the persistence rule is?
they have a URI example of /env.cgi?user=123&pw456
Please any help would be much appreciated.
thanks in advance
Andreas
2 Replies
- hoolio
Cirrostratus
Hi Andreas,
You can read up on the details for findstr here:
http://devcentral.f5.com/wiki/iRules.findstr.ashx
Basically, findstr is looking in the URI for the string "user=" and then skipping five characters forward from the first character of user= and reading up to the end of the URI or to the next &. It's trying to parse the value of the "user" parameter.
You could do this simpler using URI::query:set user [URI::query [HTTP::uri] user] if {$user ne ""}{ persist uie $user }
If you're on v9 or v10, you can use a workaround for a bug in those versions:set user [URI::query "?&[HTTP::query]" &user] if {$user ne ""}{ persist uie $user }
http://devcentral.f5.com/wiki/iRules.uri__query.ashx
Aaron - andreast_4666
Nimbostratus
thanks Hoolio!!
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
