Not sure about Json
but if you redirect to output and then use a simple grep, would that not work?
cat testfile | grep 'RX\|TX'
Code:
RX packets:9641181 errors:0 dropped:0 overruns:0 frame:0
TX packets:2630257 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:1268282716 (1.2 GB) TX bytes:257370470 (257.3 MB)
RX packets:44608 errors:0 dropped:0 overruns:0 frame:0
TX packets:44608 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:16620995 (16.6 MB) TX bytes:
Note that gets all RX tx
if you want bytes
cat testfile | grep 'RX bytes\|TX bytes'
Code:
RX bytes:1268282716 (1.2 GB) TX bytes:257370470 (257.3 MB)
RX bytes:16620995 (16.6 MB) TX bytes:16620995 (16.6 MB)
Note that this has two sets of results as I did not specify the eth0 , so I am getting eth0 and lo
Bookmarks