Forum Discussion
Simon_Knox_1115
Nimbostratus
Dec 14, 2005Any one see why this doesn't work?
when CLIENT_ACCEPTED {
set TEST [findclass [IP::remote_addr] $::DBConnections " "]
set SOURCE [IP::remote_addr]
if { [matchclass [IP::remote_addr] eq $::DBConnections] } {
set CHECK "YES" }
}
when HTTP_REQUEST {
HTTP::header insert "CONN" $CHECK
pool WIP-4
}
The data group is cotains string values formatted:
IP_Addresses Value
using the space to deliminate between the two fields. If I comment out the following lines
if { [matchclass [IP::remote_addr] eq $::DBConnections] } {
set CHECK "YES" }
And change the CONN to insert one either the value of TEST or SOURCE it works fine. But with these lines in the rule just hangs the connection.
It ought to be simple but its giving me a headache.
Cheers
Simon
- Colin_Walker_12Historic F5 AccountThe matchclass command is designed to match the entire string in the data group. If the string contains two parts seperated by a space as you described, then your matchclass is probably returning false.
[matchclass $::DBConnections starts_with [IP::remote_addr]]
- unRuleY_95363Historic F5 AccountI'll add that your probably aborting the connection because CHECK is not getting defined as a variable and then when you try to insert the CONN header, it runs into a Tcl error. You should check your /var/log/ltm file for any rule errors - I'll bet you'll find some.
else { set CHECK "NO" }
- Simon_Knox_1115
Nimbostratus
Ha, that fixed it. Thank you for your help. Obvious really when you look at it.
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