linux - How to get only ip addresses from the echo stat command -


when executing below command

echo stat | nc localhost 2181 

i getting

zookeeper version: 3.4.6-1569965, built on 02/20/2014 09:09 gmt clients: /10.999.87.01:56046[1](queued=0,recved=95261,sent=95261) /10.888.98.02:47356[1](queued=0,recved=45856,sent=45856) /10.777.09.03:53636[1](queued=0,recved=96378,sent=96380)  latency min/avg/max: 0/0/316 received: 3034250 sent: 3035252 connections: 3 outstanding: 0 zxid: 0x21000351cf mode: follower node count: 2740 

can me separate ip addresses below using commands

10.999.87.01 10.888.98.02 10.777.09.03 

so question have commands this. if yes please help. :)

... nc .... | awk -f: '/^[\/]/{sub(/^[\/]/,"",$1);print $1}' 

output

10.999.87.01 10.888.98.02 10.777.09.03 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -