Forum Discussion

James_Yang_9981's avatar
James_Yang_9981
Icon for Altostratus rankAltostratus
Mar 28, 2007

Why bigip can't load the rules corectly?

here is the rules for cache server hash:

 

 

when RULE_INIT

 

{

 

array set ::NODE_SERVERS {}

 

set ::NODE_SERVERS(0) "Squid_80 172.16.1.1 80"

 

set ::NODE_SERVERS(1) "Squid_80 172.16.1.2 80"

 

set ::NODE_SERVERS(2) "Squid_80 172.16.1.3 80"

 

set ::NODE_SERVERS(3) "Squid_80 172.16.1.4 80"

 

set ::NODE_SERVERS(4) "Squid_80 172.16.1.5 80"

 

set ::NODE_SERVERS(5) "Squid_80 172.16.1.6 80"

 

set ::nodes [array size ::NODE_SERVERS]

 

}

 

 

when HTTP_REQUEST

 

{

 

set strlen [string length [HTTP::uri]]

 

set offset [expr {[string length [HTTP::uri]]-32}]

 

set keyuri [crc32 [substr [HTTP::uri] $offset ]]

 

log "$strlen $offset [substr [HTTP::uri] $offset ]"

 

set keyuri [crc32 [HTTP::uri]]

 

set keyuri [expr abs($keyuri)]

 

set nodeid [expr {$keyuri % $::nodes}]

 

log "[HTTP::uri] $keyuri $nodeid"

 

set poolname [lindex $::NODE_SERVERS($nodeid) 0]

 

set nodeip [lindex $::NODE_SERVERS($nodeid) 1]

 

set nodeport [lindex $::NODE_SERVERS($nodeid) 2]

 

 

if { [active_members $poolname] < $::nodes }

 

{

 

log "[active_members $poolname] < $::nodes"

 

use pool $poolname

 

}

 

else

 

{

 

log "$poolname, $nodeip, $nodeport"

 

use pool $poolname member $nodeip $nodeport

 

}

 

}

 

 

I have input this rules to F5 irule editor to save to Bigip, and it passed all the checks. but when I execute "b load" from CLI. it will always get an error message:

 

 

rule test_url_hash {

 

 

/config/bigip.conf: "syntax error" at character '}' in line 76

 

rule test_url_hash {

 

 

/config/bigip.conf: "syntax error" at character '}' in line 76

 

 

I'm not sure where the error is. any one can help? the version I test on is 9.1.2 build 40.6 and 9.2.5 build 5.1.

 

 

this rules has cause the customer box can't reboot even no vs reference it.