I found a working solution, using stdbuf to run awk with no output buffering:two solutions.
$ xinput test 14 | stdbuf -o0 awk '{ print $NF }' | tee b.log
36
65
65
37
54
^C
$ cat b.log
36
65
65
37
54
Use
stdbufto runawkwith no output buffering.xinput test 14 | stdbuf -o0 awk '{ print $NF }' | tee b.logAdd
system("")call within theawkscriptxinput test 14 | awk '{ print $NF; system("") }' | tee b.log