boozer_2
June 1st, 2006, 07:24 PM
I have a small script that ssh's to a host and tee's the output to a file for logging purposes. How would one go about adding a timestamp in the log file which will show the time that the line printed on screen through the SSH session?
I'm using SSH to access a router. When troubleshooting problems, a log becomes very helpful, however when i use the command in my script like this
ssh x@y.y.y.y | tee ~/logs/$logname
it logs all the output from the ssh session, however, I want to add a timestamp to each line or every x lines so I have a general idea when the output occurred. How do I accomplish this?
I'm using SSH to access a router. When troubleshooting problems, a log becomes very helpful, however when i use the command in my script like this
ssh x@y.y.y.y | tee ~/logs/$logname
it logs all the output from the ssh session, however, I want to add a timestamp to each line or every x lines so I have a general idea when the output occurred. How do I accomplish this?