This sample goes along with the Tech Tip titled Session Table Control With iRules . It creates an iRules-based HTML application to allow you to view, edit, delete, import, and export your session subtable data.
10/1/2020 - This iRule has been updated to fix the script tag, uri, and "C"ontent issues.
How to use this snippet:
Apply to a virtual server with session table entries and you can import/export/edit/delete entries.
Code :
when HTTP_REQUEST {
set APPNAME "subtables";
set luri [string tolower [HTTP::path]]
set app [getfield $luri "/" 2];
set cmd [getfield $luri "/" 3];
set tname [URI::decode [getfield [HTTP::path] "/" 4]];
set arg1 [URI::decode [getfield [HTTP::path] "/" 5]];
set arg2 [URI::decode [getfield [HTTP::path] "/" 6]];
set resp "";
set send_response 1;
if { $app equals $APPNAME } {
log local0. "Processing application $app...";
if { $cmd eq "" } { set cmd "edit"; }
if { $tname eq "file" } { set tname ""; }
log local0. "INCOMING URI: $luri, app=$app, cmd=$cmd, tname=$tname";
set TABLENAME_FORM "
";
set FILEINPUT_FORM "
";
append resp "
iRule Table Control
I'm trying to use this but I get a blank page in my browser. (if I telnet to the vServer and request /subtables/edit, I get the proper content back, I think). I assume the comment at the top of the article about correcting the script tag means that the --> and //--> need to be removed so that only the tags remain. Am I getting that wrong?
I found this recently and greatly appreciate the code. It has made monitoring a table very easy. I do have one caution to anyone else using it. The act of refreshing the edit display to see what is in the table, resets the timeout. In my case,. I did not want the observation of the table to reset the time. I added -notouch to the line