Forum Discussion
LoveNoodles
Altocumulus
Sep 01, 2009irule - persistance for url path
Hi There;
What would be the syntax to create an irule to apply source address persistance for a particular URL path, specifying a specific timeout setting in the process.
For example:
URL path = http://pstintra/apps/aml/*
Persistance profile = source_addr
Persistance profile source_addr timeout = 2 hours or idefinite.
And if the VIP (pstintra) already has persistance applied as source_addr with a timeout setting of 180 seconds, would the irule be applied first before it looks at the VIP setting.
Thanks
- hoolio
Cirrostratus
The iRule persist command would take precedence over the VIP's configuration. If you want to do exactly what you've described (persist requests for a specific URI longer than the default VIP profile), you can use an iRule like this:when HTTP_REQUEST { Check requested path switch -glob [HTTP::path] { "/apps/aml/*" { Persist client for 10 hours persist source_addr 36000 } default { Persist client for 1 hour persist source_addr 3600 } } }
when HTTP_REQUEST { Check if there is an existing UIE persistence record if {[persist lookup uie "[IP::client_addr]_apps"] ne ""}{ Use the existing UIE persistence record regardless of which URI was requested persist uie "[IP::client_addr]_apps"] 36000 } else { Check requested path switch -glob [HTTP::path] { "/apps/aml/*" { Persist client for 10 hours using client IP _ apps persist uie "[IP::client_addr]_apps" 36000 } default { Persist client for 1 hour persist source_addr 3600 } } } }
- LoveNoodles
Altocumulus
Hoolio, many many thanks for your reply. I shall test out your suggestions in a test enviornment and get back to you. - LoveNoodles
Altocumulus
Hi there; due to the way the application behaves we have decided to implement insert cookie persistance profile for path /apps/aml/*, leaving the cookie name as blank; using default. Therefore would the irule have the following syntax: - hoolio
Cirrostratus
Cookie insert persistence seems like a good solution here as well. You can use this format: - LoveNoodles
Altocumulus
Hi Hoolio, - Michael_60932
Nimbostratus
my url is https://www.abc.com - hoolio
Cirrostratus
Hi Michael, - Michael_60932
Nimbostratus
Thank you very much Aaron,
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