f5 irules 获取 选择的POOL MEMBER 示例
以下是一个示例iRule,用于获取选择的POOL MEMBER:
when HTTP_REQUEST {
# 获取选择的POOL MEMBER的IP地址
set pool_member_ip [LB::server addr]
# 获取选择的POOL MEMBER的端口号
set pool_member_port [LB::server port]
# 将IP地址和端口号记录到日志中
log local0. "选择的POOL MEMBER: $pool_member_ip:$pool_member_port"
}
以上iRule将在每个HTTP请求时触发。它使用LB::server addr和LB::server port函数来获取选择的POOL MEMBER的IP地址和端口号,并使用log语句将其记录到名为"local0"的日志中。
请注意,此示例中的iRule仅适用于F5 BIG-IP系统。实际使用时需要根据具体的环境和需求进行适当的修改和调整。
原文地址: https://www.cveoy.top/t/topic/hOG0 著作权归作者所有。请勿转载和采集!