Forum Discussion
rdc_gayu_110274
Nimbostratus
Jul 06, 2005Unable to retrieve data with session command over different UDP connections
Hi,
I need to maintain some data over different UDP connections.
I have two UDP virtual servers, namely VS1 and VS2.
The iRules associated with VS1 are:
when CLIENT_ACCEPTED {
set key "700"
set data "testing"
session add uie $key $data
log "session entry $data with key $key added when the client is connected"
}
when SERVER_CONNECTED {
set key "700"
set data [session lookup uie $key]
log "found data $data for key $key"
}
The iRules associated with VS2 are:
when CLIENT_ACCEPTED {
set key "700"
set data [session lookup uie $key]
log "found data $data for key $key"
}
And I set up UDP connection first towards VS1, then towards VS2. However, I cannot retrieve the data stored with session command. The logs in /var/log/ltm are:
Jul 7 05:45:39 tmm tmm[663]: 01220002:6: Rule test_session_add : session entry testing with key 700 added when the client is connected
Jul 7 05:45:39 tmm tmm[663]: 01220002:6: Rule test_session_add : found data testing for key 700
Jul 7 05:45:54 tmm tmm[663]: 01220002:6: Rule test_session_get : found data for key 700
Could anyone please tell me where goes wrong? Or maybe this is not the way session command is used? Then is there any way to keep data between/over different UDP or TCP connections?
Thanks in advance!
/rdcgayu
- unRuleY_95363Historic F5 AccountOh, also, I just checked the implementation of the session command and it allows you to specify that you want to look "across virtuals" like so:
when CLIENT_ACCEPTED { set key "700" set data [session lookup uie {$key any virtual}] log "found data $data for key $key" }
- unRuleY_95363Historic F5 AccountThis should work... I will check into it.
- unRuleY_95363Historic F5 AccountI think I found your problem. I tested it and I happened to have different pools on my different virtuals which was causing it to not match. So, to make it ignore both the virtual and the pool, then you can try the following:
when CLIENT_ACCEPTED { set key "700" set data [session lookup uie {$key any}] log "found data $data for key $key" }
- rdc_gayu_110274
Nimbostratus
Hi, - david_wang_2073Historic F5 Accountperhaps you have to use [list $sss any] in "session add uie" for accross virtual, just like below
- unRuleY_95363Historic F5 AccountThat should be unnecessary. Note: that if for some reason you were to do this, you can also use the lset command: "lset lll $jsess any". This command is equivalent to: "set lll [list $jsess any]", but actually uses one less command (the list command) and so is a little more efficient.
- rdc_gayu_110274
Nimbostratus
It's working now with " set lll [list $sss any]".
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