Forum Discussion

jrmorris_151361's avatar
jrmorris_151361
Icon for Nimbostratus rankNimbostratus
May 15, 2015

Can't get LB::server addr to display in CLIENT_ACCEPTED

I am trying to get some logging sorted out currently, and I would like to be able to display the [LB::server addr] under CLIENT_ACCEPTED. Here is my iRule. I can get the output in LB_SELECTED, just not CLIENT even though I thought it was possible.

when CLIENT_ACCEPTED {
   Start log entry and display client src/dst information
   The RESOLV command below is dependant on 10.200.0.50 being UP. Otherwise, the session will fail
  log local0. "********** START OF LOG ENTRY FOR [RESOLV::lookup @10.200.0.50 [IP::client_addr]] to [RESOLV::lookup @10.200.0.50 [LB::server addr]] **********"
   log local0. "Client Src: [IP::client_addr]:[TCP::client_port], Client Dst: [clientside {IP::local_addr}]:[clientside {TCP::local_port}]"
}

when LB_SELECTED {  
  if {[IP::addr "[IP::client_addr]/22" equals "[LB::server addr]/22"]} {
  log local0. "Load Balanced Dst: [LB::server addr]"
  log local0. "*********** END OF LOG ENTRY ***********"
  snat automap
  }
}