Forum Discussion
Matt_Gruett_567
Nimbostratus
Apr 12, 2007persistence and NAME::lookup queries
All,
I'm trying to, upon HTTP request, determine if persistence already exists for a connection (using source IP) and use the pool that they are already using. If there is no persistence, I want do to a DNS lookup and then, based upon my answer, use a certain pool.
Here's my rule as is:
when HTTP_REQUEST {
Get the source IP address
set client_ip [IP::remote_addr]
Do a persistence lookup for the source IP
set persistence_pool [persist lookup source_addr $client_ip pool]
See if there's already a session for the source IP and
use the pool already assigned
if { $persistence_pool ne "" } {
use pool $persistence_pool
} else {
Do the lookup
[NAME::lookup $client_ip]
}
}
when NAME_RESOLVED {
set in_my_domain [NAME::response address 0]
Direct to corresponding pool based answer
if { $in_my_domain ne "" } {
use pool HTTP_my_domain_pool
} else {
use pool HTTP_not_my_domain_pool
}
HTTP::release
}
I get the following in the ltm log:
TCL error: Rule HTTP_my_domain_check_rule - Prerequisite operation not in progress (line 5) invoked from within "persist lookup source_addr $client_ip pool"
so obviously I need to start something ahead of this persistence lookup I would imagine, but what? Any help greatly appreciated. I've searched and browsed a lot throughout here but I don't see any specific references to using the persist lookup ability (other than the documentation example).
Please don't be afraid to point out other errors throughout the script either. I can take it!
Thanks.
-madefiver
- Colin_Walker_12Historic F5 AccountIn the HTTP_REQUEST context I'm pretty sure you want to use IP::client_addr, not IP::remote_addr to lookup the persistence entry. Could it be that this is just a bad error message trying to tell you that it couldn't find an entry? Hmmm, that shouldn't error out though, just return null.
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