irule for https logging

Hi,

I am trying to learn iRule and see how best we can use this to setup new applications and also to troubleshoot

For example if i have https traffic via VS and i want to write an irule to log info as below will this irule work??

when SERVER_CONNECTED {

log local0. “Complete connection: Client: [IP::client_addr]:[TCP::client_port]<-> Virtual: [clientside {[IP::local_addr]:[TCP::local_port]}] LTM source [IP::local_addr]:[TCP::local_port] ↔ Server: [IP::server_addr]:[TCP::server_port]”

}

I want to know Client IP, Virtual server IP, SNAT IP, POOL info, server in pool

Thanks for helping

-C

It’s mostly good, you are just missing the [clientside {}] for the client details, I’ve added it like so;

when SERVER_CONNECTED { 
log local0. "Complete connection: Client: [clientside {[IP::client_addr]:[TCP::client_port]}] <-> Virtual: [clientside {[IP::local_addr]]:[TCP::local_port]}] LTM source [IP::local_addr]:[TCP::local_port] <-> Server: [IP::server_addr]:[TCP::server_port]" 
}

I wonder if you might prefer the VS name to it’s IP and port? If so, use ‘[virtual name]’ instead.