Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

best way to touch a table key/value to refresh with specific timeout

as per title, [table lookup -subtable $sub $key] touches but sets a timeout of 180 seconds. From what i can see all other methods of refreshing will involve writing to the key/pair value which seems like a waste to me.

Is there a nice clean why to do this?

cheers

edit: right now im using table add

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi Andrew,

a [table lookup -subtable $sub $key] wouldn't set a hardcoded -timeout value of 180 seconds. Instead it would just refresh the -timeout value that was specified during the creation. Well, the default -timeout value is 180 seconds. But you are able to specify an -timeout value of your choice when using [table set/add/replace]...

You may try this rather simple demo snippet to observe the behavior of default timeouts lifetimes of table keys...

table set key1 1
table set key2 1 10 20
table set key3 1 10 indef
after 5000
set data [table lookup key2]
log local0.debug "Key1: Timeout = [table timeout -remaining key1], Lifetime = [table lifetime -remaining key1]"
log local0.debug "Key2: Timeout = [table timeout -remaining key2], Lifetime = [table lifetime -remaining key2]"
log local0.debug "Key3: Timeout = [table timeout -remaining key3], Lifetime = [table lifetime -remaining key3]"

Cheers, Kai

0