iRules script stepper

Run a short iRule snippet one command at a time and see what each command received after substitution, what it returned and which variables changed. The quickest way to understand quotes, braces, append, concat, incr and the branch if or switch took. Local, no network.

Réseau
Try
Sample request (what the iRules commands return)

These are the answers the iRules commands give in this tool. Nothing is sent anywhere: pool, HTTP::redirect and similar actions are recorded, not performed.

Finished. Last result: ∅

4 commands, in the order they started

An indented command ran inside the one above it: in its body, or in brackets while its words were being built (so it finished first).

  1. 1line 1set uri [HTTP::uri]
    receivedseturi/login.php?user=abc
    returned /login.php?user=abc
    • uri: unset → /login.php?user=abc
  2. 2line 1HTTP::uri
    receivedHTTP::uri
    returned /login.php?user=abc
  3. 3line 2if { $uri starts_with "/login" } { …
    receivedif $uri starts_with "/login" ↵ log local0. "login: $uri"↵ elseif $uri starts_with "/api" ↵ pool api_pool↵ else↵ pool web_pool↵
    returned ∅
    • A condition was true, so the body after it runs and the rest are skipped.
    Expression evaluated: $uri starts_with "/login"
    1. $uri starts_with "/login"1integer
      • starts_with is one of the operators F5 adds to iRules. It compares the values as text.
      1. $uri/login.php?user=abc
        • Reads the variable uri.
      2. "/login"/login
        • Text in double quotes, with nothing inside to substitute.
  4. 4line 2log local0. "login: $uri"
    receivedloglocal0.login: /login.php?user=abc
    returned ∅

Variables at the end

$uri
/login.php?user=abc

Logged and recorded

  • log local0. login: /login.php?user=abc

Références

Appears in these workflows