Forum Discussion
Mar 08, 2015
BIG-IP : iRule event appropriate to log final pool destination
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi
For a virtual-server assigned a complex stack of iRules, I need to log the final route destination pool ( if any ). So, this would the f...
nitass
Mar 09, 2015Employee
so if inside SERVER_CONNECTED , LB::server gives the destinated server that traffic will definitely will be routed to ? what system var gives the associated pool ?
e.g.
configuration
[root@ve11c:Active:In Sync] config tmsh 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 8
}
[root@ve11c:Active:In Sync] config tmsh list ltm pool foo
ltm pool foo {
members {
200.200.200.101:80 {
address 200.200.200.101
}
}
}
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when CLIENT_ACCEPTED {
log local0. "\[IP::client_addr\]:\[TCP::client_port\]=[IP::client_addr]:[TCP::client_port] \
\[LB::server pool\]=[LB::server pool] \
\[LB::server addr\]=[LB::server addr]"
}
when HTTP_REQUEST priority 100 {
pool foo
log local0. "pool foo"
}
when HTTP_REQUEST priority 1000 {
log local0. "\[IP::client_addr\]:\[TCP::client_port\]=[IP::client_addr]:[TCP::client_port] \
\[LB::server pool\]=[LB::server pool] \
\[LB::server addr\]=[LB::server addr] \
\[HTTP::host\]\[HTTP::uri\]=[HTTP::host][HTTP::uri]"
}
when LB_SELECTED {
log local0. "\[IP::client_addr\]:\[TCP::client_port\]=[IP::client_addr]:[TCP::client_port] \
\[LB::server pool\]=[LB::server pool] \
\[LB::server addr\]=[LB::server addr]"
}
when SERVER_CONNECTED {
log local0. "\[IP::client_addr\]:\[TCP::client_port\]=[IP::client_addr]:[TCP::client_port] \
\[LB::server pool\]=[LB::server pool] \
\[LB::server addr\]=[LB::server addr] \
\[IP::server_addr\]:\[TCP::server_port\]=[IP::server_addr]:[TCP::server_port]"
}
when HTTP_RESPONSE {
log local0. "\[IP::client_addr\]:\[TCP::client_port\]=[IP::client_addr]:[TCP::client_port] \
\[LB::server pool\]=[LB::server pool] \
\[LB::server addr\]=[LB::server addr] \
\[IP::server_addr\]:\[TCP::server_port\]=[IP::server_addr]:[TCP::server_port] \
\[HTTP::status\]=[HTTP::status]"
}
}
/var/log/ltm
[root@ve11c:Active:In Sync] config tail -f /var/log/ltm
Mar 9 13:30:21 ve11c info tmm1[15262]: Rule /Common/qux : [IP::client_addr]:[TCP::client_port]=192.168.206.73:63213 [LB::server pool]= [LB::server addr]=172.28.24.10
Mar 9 13:30:21 ve11c info tmm1[15262]: Rule /Common/qux : pool foo
Mar 9 13:30:21 ve11c info tmm1[15262]: Rule /Common/qux : [IP::client_addr]:[TCP::client_port]=192.168.206.73:63213 [LB::server pool]=/Common/foo [LB::server addr]= [HTTP::host][HTTP::uri]=172.28.24.10/
Mar 9 13:30:21 ve11c info tmm1[15262]: Rule /Common/qux : [IP::client_addr]:[TCP::client_port]=192.168.206.73:63213 [LB::server pool]=/Common/foo [LB::server addr]=200.200.200.101
Mar 9 13:30:21 ve11c info tmm1[15262]: Rule /Common/qux : [IP::client_addr]:[TCP::client_port]=192.168.206.73:63213 [LB::server pool]=/Common/foo [LB::server addr]=200.200.200.101 [IP::server_addr]:[TCP::server_port]=200.200.200.101:80
Mar 9 13:30:21 ve11c info tmm1[15262]: Rule /Common/qux : [IP::client_addr]:[TCP::client_port]=192.168.206.73:63213 [LB::server pool]=/Common/foo [LB::server addr]=200.200.200.101 [IP::server_addr]:[TCP::server_port]=200.200.200.101:80 [HTTP::status]=200
- Mar 09, 2015within LB_SELECTED , do [LB::server pool] and [LB::server addr] provide the final destination pool+server ? in other words, it's no longer possible to change destination pool within HTTP_REQUEST ( in any iRule ) ?
- nitassMar 09, 2015Employeeyes LB_SELECTED is triggered after HTTP_REQUEST, isn't it?
- Mar 09, 2015event sequence perhaps confusing because it also makes sense that in higher-priority ( lower numerical value ) irule-01 HTTP_REQUEST sets destination then LB_SELECTED fires in irule-01 but then in lower-priority ( higher numerical value ) irule-02 pool is reset to different destination pool
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