Forum Discussion

Eric_Hartwell_1's avatar
Eric_Hartwell_1
Icon for Nimbostratus rankNimbostratus
Apr 15, 2014

irule to check node connection

I want to make an irule which checks to see which node a server is connecting to. the following irule doesnt seem to write to /var/log/ltm.

 

log_node_connection

when CLIENT_ACCEPTED { log local0.info "--- Node IP address: [IP::server_addr]" } when HTTP_REQUEST { log local0.info "Client IP address: [HTTP::host] " }

 

How can I change this irule to accomplish the task?

 

thanks,

 

Eric

 

  • We use this which gives a complete picture of the connection from client to server:

    when SERVER_CONNECTED {
       This logs information about the TCP connections on *both* sides of the proxy
      set client_remote "[IP::client_addr]:[TCP::client_port]"
      set client_local  "[IP::local_addr clientside]:[TCP::local_port clientside]"
      set server_local  "[IP::local_addr]:[TCP::local_port]"
      set server_remote "[IP::server_addr]:[TCP::server_port]"
      log local0. "Got connection: Client($client_remote)<->($client_local)LTM($server_local)<->($server_remote)Server"
    }
    
  • We use this which gives a complete picture of the connection from client to server:

    when SERVER_CONNECTED {
       This logs information about the TCP connections on *both* sides of the proxy
      set client_remote "[IP::client_addr]:[TCP::client_port]"
      set client_local  "[IP::local_addr clientside]:[TCP::local_port clientside]"
      set server_local  "[IP::local_addr]:[TCP::local_port]"
      set server_remote "[IP::server_addr]:[TCP::server_port]"
      log local0. "Got connection: Client($client_remote)<->($client_local)LTM($server_local)<->($server_remote)Server"
    }