nerdexam
F5

201 · Question #47

A virtual server is listening at 10.10.1.100:80 and has the following iRule associated with it: when HTTP_REQUEST { if {[HTTP::uri] ends_with "txt" } { pool pool1 } elseif {[HTTP::uri] receive the req

The correct answer is D. Unknown. The pool cannot be determined from the information provided.. The iRule explicitly sets pools only for URIs ending with 'txt' or starting with 'jpg', and the else block is empty, leaving pool selection undetermined for other URI patterns. For a request to /images/test.gif, neither condition is met, thus the iRule provides no instruction for

Section 7: Configure Advanced Features

Question

A virtual server is listening at 10.10.1.100:80 and has the following iRule associated with it:

when HTTP_REQUEST { if {[HTTP::uri] ends_with "txt" } { pool pool1 } elseif {[HTTP::uri] receive the request.

Options

  • Apool1
  • Bpool2
  • CNone. The request will be dropped.
  • DUnknown. The pool cannot be determined from the information provided.

How the community answered

(29 responses)
  • A
    10% (3)
  • B
    3% (1)
  • C
    3% (1)
  • D
    83% (24)

Why each option

The iRule explicitly sets pools only for URIs ending with 'txt' or starting with 'jpg', and the `else` block is empty, leaving pool selection undetermined for other URI patterns. For a request to `/images/test.gif`, neither condition is met, thus the iRule provides no instruction for pool selection.

Apool1

The URI `/images/test.gif` does not end with 'txt', so `pool1` will not be selected by the iRule.

Bpool2

The URI `/images/test.gif` does not start with 'jpg', so `pool2` will not be selected by the iRule.

CNone. The request will be dropped.

The request will not necessarily be dropped; if a default pool is configured on the virtual server (information not provided), that pool would be used. If no default pool is configured and the iRule doesn't select one, the connection might eventually be reset or timed out, but 'dropped' is not a guaranteed outcome solely from the iRule.

DUnknown. The pool cannot be determined from the information provided.Correct

The iRule's `if` and `elseif` conditions explicitly check for URIs ending with 'txt' or starting with 'jpg' respectively. For the URI `/images/test.gif`, neither of these conditions is met, and the `else` block is empty, meaning no pool is explicitly set by the iRule for this specific URI. If the virtual server does not have a default pool assigned, or if the iRule fails to explicitly select one, the behavior regarding pool selection for this request is unknown based solely on the provided information.

Concept tested: F5 iRule conditional pool selection logic and default behavior

Source: https://techdocs.f5.com/en-us/big-ip-15-1-0/big-ip-irules-reference/pool.html

Topics

#iRules#HTTP_REQUEST event#URI matching#pool selection

Community Discussion

No community discussion yet for this question.

Full 201 Practice