Forum Discussion
tm500_165564
Nimbostratus
Jun 05, 2015Help with URI string-based session persistence
Hi all
Warning: Newer to F5 but really enjoying the experience so far. Trying to get my hands dirty with iRules.
I've been doing a lot of research on the forums and I haven't come across the "gol...
- Jun 11, 2015
If this happens the LB just sends the request to the same node that the TCP session is tied to - but the iRule still logs as seeing the new strID value. I was confused and expected this to create a new persistence record and load balance the request, but something tells me I would need more logic in my iRule to detach the connection and re-load balance it with a new persistence record.
you can use oneconnect profile. it will do that for you.
nitass
Employee
Jun 06, 2015i might be lost but can't we just use persist command?
e.g.
configuration
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 20
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
load-balancing-mode least-connections-member
members {
200.200.200.101:80 {
address 200.200.200.101
}
200.200.200.111:80 {
address 200.200.200.111
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
set uri [HTTP::uri]
set key [URI::query $uri strID]
if { $key ne "" } {
persist uie $key
}
}
when HTTP_RESPONSE {
log local0. "URI: $uri key: $key server: [IP::server_addr]:[TCP::server_port]"
}
}
/var/log/ltm
[root@ve11a:Active:In Sync] config tail -f /var/log/ltm
Jun 6 11:28:19 ve11a info tmm[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb22332&TimeLimit=180&User=Joe&request=submit key: Asb22332 server: 200.200.200.101:80
Jun 6 11:28:20 ve11a info tmm1[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb22332&TimeLimit=180&User=Joe&request=submit key: Asb22332 server: 200.200.200.101:80
Jun 6 11:28:20 ve11a info tmm[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb22332&TimeLimit=180&User=Joe&request=submit key: Asb22332 server: 200.200.200.101:80
Jun 6 11:28:26 ve11a info tmm1[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb12345&TimeLimit=180&User=Joe&request=submit key: Asb12345 server: 200.200.200.111:80
Jun 6 11:28:26 ve11a info tmm[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb12345&TimeLimit=180&User=Joe&request=submit key: Asb12345 server: 200.200.200.111:80
Jun 6 11:28:27 ve11a info tmm1[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb12345&TimeLimit=180&User=Joe&request=submit key: Asb12345 server: 200.200.200.111:80
Jun 6 11:28:33 ve11a info tmm[30284]: Rule /Common/qux : URI: / key: server: 200.200.200.101:80
Jun 6 11:28:34 ve11a info tmm1[30284]: Rule /Common/qux : URI: / key: server: 200.200.200.101:80
Jun 6 11:28:34 ve11a info tmm[30284]: Rule /Common/qux : URI: / key: server: 200.200.200.111:80
Jun 6 11:28:39 ve11a info tmm1[30284]: Rule /Common/qux : URI: / key: server: 200.200.200.111:80
Jun 6 11:28:47 ve11a info tmm[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb22332&TimeLimit=180&User=Joe&request=submit key: Asb22332 server: 200.200.200.101:80
Jun 6 11:28:49 ve11a info tmm1[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb22332&TimeLimit=180&User=Joe&request=submit key: Asb22332 server: 200.200.200.101:80
Jun 6 11:28:50 ve11a info tmm[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb22332&TimeLimit=180&User=Joe&request=submit key: Asb22332 server: 200.200.200.101:80
Jun 6 11:28:56 ve11a info tmm1[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb12345&TimeLimit=180&User=Joe&request=submit key: Asb12345 server: 200.200.200.111:80
Jun 6 11:28:57 ve11a info tmm[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb12345&TimeLimit=180&User=Joe&request=submit key: Asb12345 server: 200.200.200.111:80
Jun 6 11:28:57 ve11a info tmm1[30284]: Rule /Common/qux : URI: /some_uri?strID=Asb12345&TimeLimit=180&User=Joe&request=submit key: Asb12345 server: 200.200.200.111:80
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