Forum Discussion
dragonflymr
Dec 14, 2015Cirrostratus
Append to list stored in table key
Hi,
First of all I wonder if this is good idea to store list in sub/table key - considering performance nad memory consummatum. Let's say it could be list containing no more that 10 IPs.
Second I...
dragonflymr
Dec 14, 2015Cirrostratus
Stanislas,
That part is irrelevant. I will have separate sub/table to store all session ids to be able later on to retrieve all ips per session.
My main concern here was to optimize adding new ips as a list to table key value.
Based on Kai advice I think final solution is:
if {[table lookup $sess_id] eq ""} {
table set $sess_id [IP::client_addr]
} else {
if { [lsearch [table lookup $sess_id]] == -1} {
table append $sess_id " [IP::client_addr]"
}
}
What do you think?
Piotr
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