Forum Discussion
Irule Table lookup
- Feb 25, 2024
It checks if there if $tls_cache_table is equal to 1.
Check the example iRule below.
when HTTP_REQUEST { set entry "entry_1" set entry2 "entry_2" # add entry2 to table table set $entry 1 table set $entry2 "somevalue" if { [table lookup $entry] == 1 }{ log local0. "Entry $entry found and equals 1" } else { log local0. "Entry $entry not found or doesn't equal 1" } if { [table lookup $entry2] == 1 }{ log local0. "Entry $entry2 found and equals 1" } else { log local0. "Entry $entry2 not found or doesn't equal 1" } }
And the below output.
Feb 25 10:46:24 bigipa info tmm[11337]: Rule /Common/irule_table <HTTP_REQUEST>: Entry entry_1 found and equals 1 Feb 25 10:46:24 bigipa info tmm[11337]: Rule /Common/irule_table <HTTP_REQUEST>: Entry entry_2 not found or doesn't equal 1
It checks if there if $tls_cache_table is equal to 1.
Check the example iRule below.
when HTTP_REQUEST {
set entry "entry_1"
set entry2 "entry_2"
# add entry2 to table
table set $entry 1
table set $entry2 "somevalue"
if { [table lookup $entry] == 1 }{
log local0. "Entry $entry found and equals 1"
}
else {
log local0. "Entry $entry not found or doesn't equal 1"
}
if { [table lookup $entry2] == 1 }{
log local0. "Entry $entry2 found and equals 1"
}
else {
log local0. "Entry $entry2 not found or doesn't equal 1"
}
}
And the below output.
Feb 25 10:46:24 bigipa info tmm[11337]: Rule /Common/irule_table <HTTP_REQUEST>: Entry entry_1 found and equals 1
Feb 25 10:46:24 bigipa info tmm[11337]: Rule /Common/irule_table <HTTP_REQUEST>: Entry entry_2 not found or doesn't equal 1
- SV2022Feb 25, 2024Cirrus
Hi ,
thank you.. i do not see table set in out irule.so i don't think it is actually functioning.
what if there are 2 events in single irule client_accepted and followed by HTTP_Request in single irule.
when clinet_accepted{
}
Priority 10
when HTTP_request
{
}
which will be executed first? .I have an understanding that priority will work only when we have multiple irules in single VS and it will not work within a single IRULE
Recent Discussions
Related Content
* 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