I am using ssh to login to a remote server (Ubuntu), and then issue a command which outputs text/value each sec (live script).
In the live output, I want to filter out the lines containing 'dlsch_rounds'
. To do so I am using command | grep 'dlsch_rounds'
which gives the correct output.
UE 4aae: dlsch_rounds 22/0/0/0, dlsch_errors 0, pucch0_DTX 0, BLER 0.03874 MCS 9
Now, I want to filter this further such that it will show only BLER 0.03874
.
If I use command | grep 'dlsch_rounds' | awk '{print $8}'
it gives no output at all. On the other hand if I save the output in a file and the use grep and awk together, it just works fine. what am I doing wrong ?
awk
starts counting filed from 1, unlike other scripting / programming languages.command | awk '/dlsch_rounds/{print $9, $10}'
or similar instead of piping grep to awk.