Hello all gurus,
I have a long list of rules as below:
20 name:abc addr:203.45.247.247/255.255.255.255 WDW-THRESH:12 BW-OUT:10000000bps BW-IN:15000000bps STATSDEVICE:test247 STATS:Enabled (4447794/0) <IN OUT>
25 name:xyz160 addr:203.45.233.160/255.255.255.224 STATSDEVICE:test160 STATS:Enabled priority:pass-thru (1223803328/0) <IN OUT>
37 name:testgrp2 <B> WDW-THRESH:8 BW-BOTH:192000bps STATSDEVICE:econetgrp2 STATS:Enabled (0/0) <Group> START:NNNNNNN-255-0 STOP:NNNNNNN-255-0
62 name:blahblahl54 addr:203.45.225.54/255.255.255.255 WDW-THRESH:5 BWLINK:cbb256 BW-BOTH:256000bps STATSDEVICE:hellol54 STATS:Enabled (346918/77) <IN OUT>
Using SED or AWK or combination of both, can I get output like below:
20 15000000 10000000
25
37 192000
62 256000
Basically the rule number, followed by the value after BW-IN and followed by the value after BW-OUT
and
rule number, followed by the value BW-BOTH
and
just the rule number, if there are no BW-OUT, BW-IN and BW-BOTH
The rule line contains either BW-BOTH or BW-OUT and BW-IN. But never all three.
Thank you so much for your valuable time.
sb245