Ping can print you a timestamp on every line but its in unix date format 🙁
ping -D localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
[1415629479.482938] 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.057 ms
I'm looking for a simple pipe command that can convert them on the fly to something like this:
[Sat 14 Feb 2009 01:31:30 SAST] 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.057 ms
Also I want it to run continuously, it shouldn't wait for the command to terminate before printing results.
Best Answer
From : https://stackoverflow.com/questions/14036116/convert-timestamp-to-datetime-with-sed
with bit of scripting...
Runs as