For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

JTucker_137331's avatar
JTucker_137331
Icon for Nimbostratus rankNimbostratus
Mar 26, 2014

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

  • 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" }
    }
    
  • 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