Hmm... I am not quite sure what you are trying to do.  If you are
trying to see how many established connections from each client
connected to your server on TCP port 80, then the following command
will probably give you what you need:

netstat -tn |grep "EST" | awk '{print $5}' |sort | uniq -c

Huy

--
Huy Le
Spring Partners, Inc.
http://www.springpartners.com  | http://www.TheSimpleMe.com


On Aug 26, 12:34 pm, "Jibu Chacko" <[EMAIL PROTECTED]> wrote:
> Hi,
>  I need to use two files as input in an awk script. So i thought i'll do
> nested awk. I'm writing a script to count the number of IPs connected to
> port IP and the count of each IP. I tied as so.
>
> *netstat -plant|grep ':80'|awk -F : '{print $2}'|awk '{print $2}' >
> netstat.tmp
>
> cat netstat.tmp |uniq > netstatall.tmp
>
> awk '{
>          for (i=1;i<=NF;i++)
>            {
>             ip=$i; printf("%s\n",ip);
>
>             awk '{
>                       for (c=1;c<=NF;c++)
>                        {
>                        if (ip == $c);
>                        count++
>                        }
>                        printf("%s\t%d",ip,count);
>                     }' netstat.tmp
>
>               }
>            }' netstatall.tmp*
>
> Is the correct syntax or how do i use a awk script in another, or, how do i
> use two input files????
> --
> "The will of God will never take you where the Grace of God will not protect
> you."

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [EMAIL PROTECTED]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---

Reply via email to