Problem this snippet solves:
Sample Request:
Requirement:
Extract Account ID from request URI such as ‘abcdefgh-ijkl-mnop-qrst-0123456789’
Then load balance traffic based on Account ID, and persist the same Account ID to the same backend pool member.
How to use this snippet:
Code :
when HTTP_REQUEST {
set index1 [string first "/" [HTTP::uri] ]
set accountid [string range [HTTP::uri] [incr index1] end ]
#log local0. "Account ID is: $accountid and will be persisted to same backend"
persist hash $accountid
}
when LB_SELECTED {
#log local0. "Backend is: [LB::server name]"
}
#Michelangelo Dorado | Nov 2021
Tested this on version:
No Version Found