Forum Discussion
TCL Routing Error for iRule Debug
Hi,
I have the following iRule that I would like to get some of the debug output from sent to an external server but I get this error when I set "debug 1" to enable the debug with an external server defined.
TCL error: /Common/iRule_Global_Quality_500_RMQ_LB_Hook - Routing problem (line 1) (line 1) invoked from within "log -noname 172.22.0.90:514 local0. "$log_prefix Lookup Session Table for existing Master Node Entry." "
The logging server is accessible (I have verified this by turning on remote logging directly to the server) so seems to be that this is an iRule routing specific issue rather than a network routing issue.
Here is the iRule in full:
when CLIENT_ACCEPTED {
set debug 0
set log_prefix "Debug: \"[IP::client_addr]:[TCP::client_port]\" >"
Handler for RMQ Admin Page
Handler for RMQ LB Hook
if { $debug } { log -noname 172.22.0.90:514 local0. "$log_prefix Lookup Session Table for existing Master Node Entry." }
switch -exact -- [table lookup -notouch "[LB::server pool]\-Master"] "" {
if { $debug } { log -noname local0. "$log_prefix Master Node Entry not found. Electing a new Master Node and writing new Master Node Entry." }
set new_pool [LB::select]
table set "[LB::server pool]\-Master" "$new_pool" indef indef
eval $new_pool
} default {
if { $debug } { log -noname local0. "$log_prefix Master Node Entry found. Checking current availability of Master Node." }
switch -exact -- [eval LB::status [table lookup -notouch "[LB::server pool]\-Master"]] "up" {
if { $debug } { log -noname local0. "$log_prefix Master Node is still up and running. Using Master Node Entry as Pool Server." }
eval [table lookup -notouch "[LB::server pool]\-Master"]
} default {
if { $debug } { log -noname local0. "$log_prefix Master Node is not up and running. Electing a new Master Node and writing new Master Node Entry." }
set new_pool [LB::select]
table set "[LB::server pool]\-Master" "$new_pool" indef indef
eval $new_pool
}
}
unset -nocomplain new_pool
}
Ultimately I would like all these messages to be logged externally but one line at a time 🙂
Thank you.
James
3 Replies
- Kevin_Stewart
Employee
I get a similar error when attempting to send more than one remote syslog message this way. I would suggest switching to HSL:
when CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool syslog-ubuntu-pool] set debug 1 set log_prefix "Debug: \"[IP::client_addr]:[TCP::client_port]\" >" if { $debug } { HSL::send $hsl "<134>$log_prefix log stuff" } if { $debug } { HSL::send $hsl "<134>$log_prefix log more stuff" } if { $debug } { HSL::send $hsl "<134>$log_prefix log something else" } } - JTucker_137331
Nimbostratus
Thank you for the quick response!
So I think that the code might look like this:
when CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool Pool_Office_z-syslog_UDP514] set debug 1 set log_prefix "Debug: \"[IP::client_addr]:[TCP::client_port]\" >" if { $debug } { HSL::send $hsl "<134>$log_prefix Lookup Session Table for existing Master Node Entry." } }Will give it a try and see what happens!
Thanks
James
- JTucker_137331
Nimbostratus
Works a treat, thanks very much!
Recent Discussions
Related Content
* 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
