Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
OMD[workshop]:~/local/bin$ OMD[workshop]:~$ ~/lib/cmc/icmpreceiver |python3 ~/local/bin/dump.py |grep --line-buffered  "127.0.0.1" |perl -pe 'use POSIX strftime; print strftime "[%Y-%m-%d %H:%M:%S] ", localtime'
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:24] 127.0.0.1
[2021-09-29 11:44:25] 127.0.0.1

or

Code Block
 ~/lib/cmc/icmpreceiver |python3 ./dump.py |grep --line-buffered  "127.0.0.1" |ts -i



if perl is not possible, you will find here : https://unix.stackexchange.com/questions/26728/prepending-a-timestamp-to-each-line-of-output-from-a-command

...