Hi,
I am trying to run a command and storing output via js, but the packets captured and buffer time gets difference of 500ms to 1 sec. I want to narrow it down to 50milli-secons.
Here is the command: sudo tshark -i eno1 -l -x -T ek "udp port 37008" | stdbuf -o0 grep timestamp |stdbuf -o0 jq -r -c '"{\"data\": \"(.layers.frame_raw)\", \"ipSrc\": \"(.layers.ip.ip_ip_src)\", \"timestamp\":\"(.layers.frame.frame_frame_time)} "' | stdbuf -o0 ts '%Y%m%d-%H:%M:%.S'
output:
20210208-11:39:11.821374 {"data": "d0946648264170b3d5f2b1420800450000cd154a40004011a023c0a80193c0a801cfe700909000b95917001480ad4eb0d3a226cabde3e1d1df9c8a798788441e9285f170000000fd7d0fa1007fff80805a0f00020214c1c0ffe9bfe50fe1fffc0ffe4bfd42fd9fffc0ffcd3fe08fb5fffc10014bfddefb5fffc1001bbffdaf7ffffc1001ac0058f7dfffc1001c3ffc4fa1fffc0ffe2bff1cfd7fffc0ffc43fe92ff9fffc100143ff2cfedfffc1000ebff3cfe5fffc0ffebbff26fb5fffc100393fe72f93fffc10066bff7904dfffc100554003d07dfffcfffec800", "ipSrc": "192.168.1.147", "timestamp":"Feb 8, 2021 11:39:11.173803555 EST} 20210208-11:39:11.821696 {"data": "d0946648264170b3d5f2b1420800450000cd155140004011a01cc0a80193c0a801cfe700909000b9badd001480ad4ef0d3a226cad6e3e1d1df9c8a798788441a1883f070000000fd7d0fa1007fff80805a0f00020214c1c0ffe9bfe50fe1fffc0ffe4bfd42fd9fffc0ffcd3fe08fb5fffc10014bfddefb5fffc1001bbffdaf7ffffc1001ac0058f7dfffc1001c3ffc4fa1fffc0ffe2bff1cfd7fffc0ffc43fe92ff9fffc100143ff2cfedfffc1000ebff3cfe5fffc0ffebbff26fb5fffc100393fe72f93fffc10066bff7904dfffc100554003d07dfffcfffec800", "ipSrc": "192.168.1.147", "timestamp":"Feb 8, 2021 11:39:11.272990338 EST} 20210208-11:39:11.822250 {"data": "d0946648264170b3d5f2b1420800450000cd155240004011a01bc0a80193c0a801cfe700909000b9985d001480ad4f30d3a226caf023e1d1df9c8a798788441a1883f970000000fd7d0fa1007fff80805a0f00020214c1c0ffe9bfe50fe1fffc0ffe4bfd42fd9fffc0ffcd3fe08fb5fffc10014bfddefb5fffc1001bbffdaf7ffffc1001ac0058f7dfffc1001c3ffc4fa1fffc0ffe2bff1cfd7fffc0ffc43fe92ff9fffc100143ff2cfedfffc1000ebff3cfe5fffc0ffebbff26fb5fffc100393fe72f93fffc10066bff7904dfffc100554003d07dfffcfffec800", "ipSrc": "192.168.1.147", "timestamp":"Feb 8, 2021 11:39:11.373111721 EST}