e.g.
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.19.252:80
ip-protocol tcp
mask 255.255.255.255
profiles {
http { }
tcp { }
}
rules {
myrule
}
snat automap
vlans-disabled
}
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm data-group internal https_rp_list
ltm data-group internal https_rp_list {
records {
"services.domain.com/path/ services-rp.domain.com/path/ services-rp_pool" { }
"services.domain.com/path/Enquiry/ services-rp.domain.com/path/Enquiry/ services-rp_pool" { }
}
type string
}
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
foreach elm [class get https_rp_list] {
set hosturi [getfield [lindex $elm 0] " " 1]
if { "[HTTP::host][HTTP::uri]" starts_with $hosturi } {
set start [string first "/" $hosturi]
set host [string range $hosturi 0 [expr {$start - 1}]]
set uri [string range $hosturi $start end]
set newhosturi [getfield [lindex $elm 0] " " 2]
set start [string first "/" $newhosturi]
set newhost [string range $newhosturi 0 [expr {$start - 1}]]
set newuri [string range $newhosturi $start end]
set newpool [getfield [lindex $elm 0] " " 3]
log local0. ""
log local0. "Org Host = [HTTP::host]"
log local0. "Org URI = [HTTP::uri]"
log local0. "New Host = $newhost"
log local0. "New URI = $newuri"
log local0. "HTTP::header replace Host $newhost"
log local0. "HTTP::uri \[string map {$uri $newuri} [HTTP::uri]\]"
log local0. "HTTP::uri [string map {$uri $newuri} [HTTP::uri]]"
log local0. "pool $newpool"
log local0. ""
break
}
}
}
}
[root@ve11a:Active:Changes Pending] config tail -f /var/log/ltm
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule :
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : Org Host = services.domain.com
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : Org URI = /path/something
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : New Host = services-rp.domain.com
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : New URI = /path/
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : HTTP::header replace Host services-rp.domain.com
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : HTTP::uri [string map {/path/ /path/} /path/something]
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : HTTP::uri /path/something
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule : pool services-rp_pool
Oct 16 17:11:04 tmm info tmm[23647]: Rule /Common/myrule :
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule :
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : Org Host = services.domain.com
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : Org URI = /path/Enquiry/something
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : New Host = services-rp.domain.com
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : New URI = /path/Enquiry/
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : HTTP::header replace Host services-rp.domain.com
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : HTTP::uri [string map {/path/Enquiry/ /path/Enquiry/} /path/Enquiry/something]
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : HTTP::uri /path/Enquiry/something
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule : pool services-rp_pool
Oct 16 17:11:07 tmm info tmm[23647]: Rule /Common/myrule :