Help with netstat

Hi,

I want to list the time for how long a secure connections last to my server/blade. i am using netstat command to get the same, but not sure how to get the time for how long connections is being ESTABLISHED.

netstat -na | grep 'ESTABLISHED' | grep :443 |awk '{print $4}' | cut -d: -f1 | uniq -c | sort -rn

Output is as below

 2036 10.219.3.132

How do i find the for how long it is actually keeping the secure connection established. please advice.

-Siddhesh

You won't, because netstat -an doesn't display this kind of information.

You could issue your line over and over again in a loop and increment a counter accordingly for as long as the connection exists.

I hope this helps.

bakunin