Forum Discussion
DarylCarr_16045
Nimbostratus
Jul 02, 2014Parse node name from url with iRule
Hi,
I am new to the F5 world and loving the new learning experience. Can someone help with the below?
I have a VIP that will front several dev machines that have multiple websites on them w...
nitass
Employee
Jul 03, 2014e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 46
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm data-group internal host-to-node
ltm data-group internal host-to-node {
records {
MSxxxxx {
data 200.200.200.101:80
}
}
type string
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
log local0. "host=[HTTP::host] uri=[HTTP::uri]"
if { [scan [HTTP::host] {%[^-]} ht] == 1 } {
log local0. "ht=$ht"
set nd [split [class match -value $ht equals host-to-node] :]
log local0. "nd=$nd"
node [lindex $nd 0] [lindex $nd 1]
log local0. "cmd=node [lindex $nd 0] [lindex $nd 1]"
}
}
}
/var/log/ltm
[root@ve11a:Active:In Sync] config tail -f /var/log/ltm
Jul 2 19:27:13 ve11a info tmm[29362]: Rule /Common/qux : host=MSxxxxx-help-sp.domain.net uri=/something
Jul 2 19:27:13 ve11a info tmm[29362]: Rule /Common/qux : ht=MSxxxxx
Jul 2 19:27:13 ve11a info tmm[29362]: Rule /Common/qux : nd=200.200.200.101 80
Jul 2 19:27:13 ve11a info tmm[29362]: Rule /Common/qux : cmd=node 200.200.200.101 80
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects