Use awk array to count log access status and network connection status
Count ip and pv number visited by ip
#awk '{s[$1]++}END{for(key in s) print key,s[key]}' 12.log | sort -k2rn | head
Count the number of connections in various states of the current network
#netstat -na | awk '/^tcp/{s[$6]++}END{for(key in s) print key,s[key]}'
Note: awk also supports filtering/^tcp/filtering lines starting with tcp
Counting IP and connection times currently being established
#netstat -an | grep ESTAB | awk -F "[ :]+" '{print $6}' | sort | uniq -c
#netstat -an | grep "^tcp\>" | awk -F "[ :]+" '{s[$6]++}END{for(key in s) print key,s[key]}'
Count the number of connections in various states
netstat -an | grep "^tcp\>" | awk -F "[ :]+" '{s[$8]++}END{for(key in s) print key,s[key]}'