Forum Discussion
dragonflymr
Cirrostratus
Dec 14, 2015Append 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 wonder if there is faster more elegant way to actually add new value to the list. My idea is:
set c_val [table lookup -subtable ip [IP::client_addr]]
lappend c_val $new_val
table set -subtable ip [IP::client_addr] $c_val
Seems to be a lot overhead here, so maybe there is better way?
Piotr
20 Replies
- Stanislas_Piro2
Cumulonimbus
What will be the values new_val?
How will you use it?
Will these keys expire? (you do not have set timeout)
you may create one subtable per IP address and define one key per val...
table add -subtable ip-[IP::client_addr] $c_val 1 3600 foreach c_val [table keys -notouch -subtable ip-[IP::client_addr] ] { do what you want }
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
