Forum Discussion
brad_11452
Nimbostratus
Mar 23, 2007Persist on uri argument
I am new to irules and am trying to set up persistence based on an argument passed in the uri. Here is a sample:
http://mydomain.com/test.jsp?clientIp=10.1.1.47
So I want to persist on 10.1.1.47
Here is what I have so far:
when HTTP_REQUEST {
set host [HTTP::host]
set uri [HTTP::uri]
set path [URI::path [HTTP::uri]]
set query [URI::query [HTTP::uri]]
set ip [URI::query [HTTP::uri] "clientIp"]
persist uie $ip
}
I can see records in the persistence tables that contain the IP address but persistence does not seem to be entirely working.
Any thoughts or help would be greatly appreciated.
Thanks
2 Replies
- Colin_Walker_12Historic F5 AccountI think you can simplify your rule a little.
Try something like:when HTTP_REQUEST { persist uie [URI::query [HTTP::uri]] }
All you're looking to accomplish is to set a unique token that will only change when the clientIP value changes. This should be a simple way of doing so.
Colin - brad_11452
Nimbostratus
Thanks Colin, that does the trick in my quick little tests!
Brad
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
