Forum Discussion

millencol1n_619's avatar
millencol1n_619
Icon for Nimbostratus rankNimbostratus
Dec 21, 2009

Log pool member

hi irule wizards,

 

 

this will be a quick one for you =)

 

i just wanna log the pool member to local.0 that is uses for each single connection attempt.

 

 

thx!

8 Replies

  • Here is the most basic version I can think of (untested, check for typos please):

       
       when LB_SELECTED {   
          Once pool member has been selected log it.   
         log local0. "Selected member: [LB::server addr]"   
       }   
      

    HTH,

    Matt
  • if you want log each and every connection request, use below

     

    when HTTP_REQUEST {

     

    Once pool member has been selected log it.

     

    log local0. "Selected member: [LB::server addr]"

     

    }

     

    • Mohammed_M_Irfa's avatar
      Mohammed_M_Irfa
      Icon for Nimbostratus rankNimbostratus

      Hi Noushad,

       

      I have tested your suggested in my lab,but it is not working. while HTTP_REQUEST is not able to detect the pool member.

       

      L4L7 iRule is working fine and it gives the correct output.

       

      Output: "Rule /Common/LB_SELECTED_Log_pool_member : Selected member: 10.1.20.11"

       

      Thanks Noushad and L4L7 for iRule.

       

    • Noushad_Vellad1's avatar
      Noushad_Vellad1
      Icon for Altostratus rankAltostratus

      As per my testing, LB_SELECTED is not triggered for each HTTP requests. Depending on settings like persistence, Load balancing, OneConnect Profile etc, LB_SELECTED may not be triggered all the time. So I would recommend you run below irule

       

      when LB_SELECTED {

       

      Once pool member has been selected log it.

       

      log local0. "Selected member: [LB::server addr]"

       

      }

       

      when HTTP_REQUEST { Once pool member has been selected log it. log local0. "Selected member: [LB::server addr]" }

       

  • if you want log each and every connection request, use below

     

    when HTTP_REQUEST {

     

    Once pool member has been selected log it.

     

    log local0. "Selected member: [LB::server addr]"

     

    }

     

    • Mohammed_M_Irfa's avatar
      Mohammed_M_Irfa
      Icon for Nimbostratus rankNimbostratus

      Hi Noushad,

       

      I have tested your suggested in my lab,but it is not working. while HTTP_REQUEST is not able to detect the pool member.

       

      L4L7 iRule is working fine and it gives the correct output.

       

      Output: "Rule /Common/LB_SELECTED_Log_pool_member : Selected member: 10.1.20.11"

       

      Thanks Noushad and L4L7 for iRule.

       

    • Noushad_Vellada's avatar
      Noushad_Vellada
      Icon for Nimbostratus rankNimbostratus

      As per my testing, LB_SELECTED is not triggered for each HTTP requests. Depending on settings like persistence, Load balancing, OneConnect Profile etc, LB_SELECTED may not be triggered all the time. So I would recommend you run below irule

       

      when LB_SELECTED {

       

      Once pool member has been selected log it.

       

      log local0. "Selected member: [LB::server addr]"

       

      }

       

      when HTTP_REQUEST { Once pool member has been selected log it. log local0. "Selected member: [LB::server addr]" }