Forum Discussion
Tal_BenHaim_112
Nimbostratus
Oct 03, 2006LB::reselect - LB_SELECTED event occures twice
Im trying to write a rule that will select the pool member according to a parameter in the query string .
It seems that the LB_SELECTED event occurs twice.
in the first occurence the pool name is: "xxx"
in the second occurence the pool name is: "_tmm_asm_http_pool"
so the i-rule fails...
the i-rule :
when HTTP_REQUEST {
set ip [IP::client_addr]
set uri [HTTP::uri]
set query [HTTP::query]
set f 0
set d 0
if {([IP::addr [IP::client_addr] equals 192.118.92.3])}
{
log local0. "$ip"
}
}
when LB_SELECTED {
set uri [HTTP::uri]
set host [HTTP::host]
set query [HTTP::query]
set s [LB::server]
set pm [string index $query 3]
set pool [LB::server pool]
log local0. "uri: @$uri@ pm: @$pm@"
if { ([IP::addr [IP::client_addr] equals 192.118.92.3]) and ($uri starts_with "/?pm")}
{
set p [LB::server addr]
set pool [LB::server pool]
if { $host starts_with "gt-q" }
{
if { $pm equals "1" }
{
LB::reselect $pool 192.168.152.4
set pool2 [LB::server pool]
log local0. "pool2: @$pool2@"
log local0. "1pm: @$pm@ host:: @$host@ pool addr: @$p@ uri: @$uri@ server: @$s@ query:
@$query@"
}
}
}
}
the output:
Oct 3 15:09:31 tmm tmm[1125]: Rule SelectPool : 192.118.92.3
Oct 3 15:09:31 tmm tmm[1125]: Rule SelectPool : uri: @/?pm=1@ pm: @1@
Oct 3 15:09:31 tmm tmm[1125]: Rule SelectPool : pool2: @xxx@
Oct 3 15:09:31 tmm tmm[1125]: Rule SelectPool : uri: @/?pm=1@ pm: @1@
Oct 3 15:09:31 tmm tmm[1125]: Rule SelectPool : pool2: @_tmm_asm_http_pool@
2) Is the tmm log file maintained by the big-ip?
Is it deleted by the big-ip when it reaches a specific size limit?
Thanks,
Tal
- R__Scott_Wood_8Historic F5 AccountHi,
- R__Scott_Wood_8Historic F5 AccountA clarification about the TMM log file. In general, BIG-IP log files are rotated daily, but depending on your BIG-IP version, the TMM log file may be an exception - some releases rotate the TMM log based on size. For more complete details, please contact F5 Support.
- hoolio
Cirrostratus
Hi Tal, - hoolio
Cirrostratus
In the upcoming 9.2.4 release, you can select a pool in the HTTP_REQUEST event, in a custom rule attached to a virtual server that also has an HTTP class with ASM enabled. 9.2.4 should be released shortly. Check the release notes page for ASM on AskF5 for more detail. - hoolio
Cirrostratus
Actually, it was pointed out that my last note wasn't correct.when HTTP_REQUEST { set uri [HTTP::uri] log local0. "uri: $uri" if { $uri starts_with "/pool" }{ pool http_request_pool log local0. "Set pool to http_request_pool" } elseif { [HTTP::uri] starts_with "/node"}{ node 10.10.31.14 80 log local0. "Set node to 10.10.31.14 80" } else { log local0. "No match in HTTP_REQUEST, using default pool" } } when HTTP_CLASS_SELECTED { if { $uri starts_with "/selected/pool" }{ pool http_class_selected_pool log local0. "Set pool to http_class_selected_pool" } elseif { [HTTP::uri] starts_with "/selected/node"}{ node 10.10.31.15 80 log local0. "Set node to 10.10.31.15 80" } else { log local0. "No match in HTTP_CLASS_SELECTED, using default pool" } }
virtual asm_http_vip { destination 172.24.59.174:http snat automap ip protocol tcp profile http tcp rule select_pool_node_rule httpclass asm_httpclass } profile httpclass asm_httpclass { defaults from httpclass hosts none paths none headers none cookies none pool httpclass_pool asm enable }
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