Forum Discussion
IRULE SIDE BAND CONECTION HTTP
Hello
I'm working with an irule that makes a connection with a server to get a file from this, and save the information on a table and a sub table, at this moment I have used the sintax command "[table lookup -subtable $db_cache_table [HTTP::path]]", this is good when the /uri match the table /uri,however I need to find the way to do the same sintax with "star_with" or "containts" the path or uri.
any suggestions please?
Hi Jaime,
Can you try this?
set tableKeys [table keys -subtable $db_cache_table] foreach key $tableKeys { if { $key starts_with [HTTP::path] } { # log local0. "KEY: $key # log local0. "PATH: [HTTP::path]" } }
Hi Jaime,
Can you try this?
set tableKeys [table keys -subtable $db_cache_table] foreach key $tableKeys { if { $key starts_with [HTTP::path] } { # log local0. "KEY: $key # log local0. "PATH: [HTTP::path]" } }
- Jaime_QuirogaNimbostratus
Hello
Thanks for your time in this response. I worked with this code and completed with the next code.
- when HTTP_REQUEST {
- set path_normal [HTTP::path]
- set tableKeys [table keys -subtable $db_cache_table]
- set new_path_normal [substr $path_normal 1 .]
- foreach key $tableKeys {
- if { $key contains $new_path_normal } {
- set path_virtual [table lookup -subtable $db_cache_table $key]
- }
- }
- set newpath_virtual [string map {" " "" \n "" \r ""} $path_virtual]
- if { $newpath_virtual ne "" } { virtual $newpath_virtual }
- }
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