Classification: Public
I'd probably be using Unix to do this, after all, netstat has its roots there.
netstat | awk '{ n = split($3,p,"\.\."); if (p[2]=="8080") ip[p[1]]++; } END {
for (i in ip) print "IP address",i,"occurs",ip[i],"times.";}'
Andy Styles
z/Series Systems Programmer
-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of
Lizette Koehler
Sent: Tuesday, July 2, 2024 10:03 AM
To: [email protected]
Subject: reading tso netstat for counting duplicates
*** This email is from an external source - be careful of attachments and
links. Please report suspicious emails ***
I am working with output from
tso netstat (port 8080
There are header and then lines with 4 fields
I need to take the third field and count how many times the IP shows up in the
listing
What would be the best process.. I need to strip the port from the field
IP..PORT then count the number of times the IP shows up in the output
Thanks in advance for your suggestions
Lizette
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
[email protected] with the message: INFO IBM-MAIN
Lloyds Banking Group plc. Registered Office: The Mound, Edinburgh EH1 1YZ.
Registered in Scotland no. SC95000. Telephone: 0131 225 4555.
Lloyds Bank plc. Registered Office: 25 Gresham Street, London EC2V 7HN.
Registered in England and Wales no. 2065. Telephone 0207626 1500.
Bank of Scotland plc. Registered Office: The Mound, Edinburgh EH1 1YZ.
Registered in Scotland no. SC327000. Telephone: 03457 801 801.
Lloyds Bank Corporate Markets plc. Registered office: 25 Gresham Street, London
EC2V 7HN. Registered in England and Wales no. 10399850.
Scottish Widows Schroder Personal Wealth Limited. Registered Office: 25 Gresham
Street, London EC2V 7HN. Registered in England and Wales no. 11722983.
Lloyds Bank plc, Bank of Scotland plc and Lloyds Bank Corporate Markets plc are
authorised by the Prudential Regulation Authority and regulated by the
Financial Conduct Authority and Prudential Regulation Authority.
Scottish Widows Schroder Personal Wealth Limited is authorised and regulated by
the Financial Conduct Authority.
Lloyds Bank Corporate Markets Wertpapierhandelsbank GmbH is a wholly-owned
subsidiary of Lloyds Bank Corporate Markets plc. Lloyds Bank Corporate Markets
Wertpapierhandelsbank GmbH has its registered office at Thurn-und-Taxis Platz
6, 60313 Frankfurt, Germany. The company is registered with the Amtsgericht
Frankfurt am Main, HRB 111650. Lloyds Bank Corporate Markets
Wertpapierhandelsbank GmbH is supervised by the Bundesanstalt für
Finanzdienstleistungsaufsicht.
Halifax is a division of Bank of Scotland plc.
HBOS plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in
Scotland no. SC218813.
This e-mail (including any attachments) is private and confidential and may
contain privileged material. If you have received this e-mail in error, please
notify the sender and delete it (including any attachments) immediately. You
must not copy, distribute, disclose or use any of the information in it or any
attachments. Telephone calls may be monitored or recorded.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN