kman_52500
Oct 17, 2007Nimbostratus
irule loggin a class caused all Irules using that clase to fail
Can anyone provide any insight to this problem?
I recently created this rule that logged a class valid_methods
when HTTP_REQUEST {
if { not [matchclass [HTTP::method] equals $::valid_methods] } {
reject
} elseif { [HTTP::uri] contains "cmd.exe" || [HTTP::uri] contains "root.exe" || [HTTP::uri] contains "admin.dll" } {
discard
} elseif { not([HTTP::method] eq \"POST\") } {
set url https://[getfield [HTTP::host] \":\" 1][HTTP::uri]
HTTP::respond 301 \"Location\" \"$url\"
} else {
set log_line \"REDIRECT_POST [IP::remote_addr] [HTTP::host] [HTTP::uri] [HTTP::header Referer]\"
log local0.info \"$log_line [$::valid_methods]\"
}
}
All rules refering to $::valid_methods started failing after I added the line:
log local0.info \"$log_line [$::valid_methods]\"
to this irule
even after removing "[$::valid_methods]" from it, other rules continued to fail with the following error:
Invalid matchclass operands - no class or list type found, lhs: const string, rhs: cmdName (line 5) invoked from within "matchclass [HTTP::method] equals $::valid_methods
The initial error reported by the actual iRule being edited was:
invalid command name "{GET} {HEAD} {OPTIONS} {POST}" while executing "$::valid_methods"
after that the flood of "no class or list type found" messages started rolling in for all iRules refering to $::valid_methods