101 · Question #68
The following iRule is being used within a persistence profile on a virtual server. Assuming the following HTTP requests are made within the same timeout window, what is the maximum number of persiste
The correct answer is A. 4. The iRule extracts a 3-character substring from a fixed offset after '?' in the URI as the UIE persistence key; with the provided requests, exactly 4 unique key values are produced, creating a maximum of 4 persistence records.
Question
The following iRule is being used within a persistence profile on a virtual server. Assuming the following HTTP requests are made within the same timeout window, what is the maximum number of persistence records that will be created iRule:
rule Persist_Universal { when HTTP_REQUEST { persist uie [findstr [HTTP ::uri] "?" 8 3] } Requests:
Options
- A4
- B3
- C10
- DIt cannot be determined from the given data.
- E5
- F1
- G0
How the community answered
(27 responses)- A48% (13)
- C7% (2)
- D4% (1)
- F15% (4)
- G26% (7)
Why each option
The iRule extracts a 3-character substring from a fixed offset after '?' in the URI as the UIE persistence key; with the provided requests, exactly 4 unique key values are produced, creating a maximum of 4 persistence records.
The 'persist uie' command creates one persistence record per unique key value, and the key is derived by 'findstr [HTTP::uri] "?" 8 3', which skips 8 characters after the '?' and captures the next 3 characters. Because the given HTTP requests within the same timeout window yield exactly 4 distinct 3-character substrings, at most 4 separate UIE persistence records are created - one per unique extracted key.
3 records underestimates the result because the given request set contains 4 unique URI substrings that each map to a distinct persistence key.
10 records is too high and would require 10 unique 3-character substrings across the provided requests, which exceeds what the data supports.
The maximum is determinable from the listed requests by extracting and counting unique 3-character substrings at the specified offset, so the answer is not indeterminate.
5 records exceeds the number of unique key values extractable from the provided request URIs based on the iRule's extraction logic.
1 record would only occur if all provided requests produced the same 3-character substring at the specified position, which contradicts the given data.
0 records would require the iRule to never fire or always produce an empty key, but valid HTTP_REQUEST events with qualifying URIs will produce non-empty persistence keys.
Concept tested: UIE persistence record creation with iRule findstr extraction
Source: https://clouddocs.f5.com/api/irules/persist.html
Topics
Community Discussion
No community discussion yet for this question.