Skip to main content
The 2024 Developer Survey results are live! See the results
replaced http://superuser.com/ with https://superuser.com/
Source Link

The quick and dirty way that comes to mind is to tail each log file on each remote machine and redirect them to temporary files locally. Then, tail both logs with the method golimar suggestedgolimar suggested.

  1. ssh user@host1 -C tail -f /path/to/log >> /tmp/log1.tmp
  2. ssh user@host2 -C tail -f /path/to/log >> /tmp/log2.tmp
  3. tail -q -f /tmp/log1.tmp /tmp/log2.tmp

It's not pretty, requires keeping local data, and requires the first 2 commands to be background'ed (or run in screen or similar), but it should get the job done!

The quick and dirty way that comes to mind is to tail each log file on each remote machine and redirect them to temporary files locally. Then, tail both logs with the method golimar suggested.

  1. ssh user@host1 -C tail -f /path/to/log >> /tmp/log1.tmp
  2. ssh user@host2 -C tail -f /path/to/log >> /tmp/log2.tmp
  3. tail -q -f /tmp/log1.tmp /tmp/log2.tmp

It's not pretty, requires keeping local data, and requires the first 2 commands to be background'ed (or run in screen or similar), but it should get the job done!

The quick and dirty way that comes to mind is to tail each log file on each remote machine and redirect them to temporary files locally. Then, tail both logs with the method golimar suggested.

  1. ssh user@host1 -C tail -f /path/to/log >> /tmp/log1.tmp
  2. ssh user@host2 -C tail -f /path/to/log >> /tmp/log2.tmp
  3. tail -q -f /tmp/log1.tmp /tmp/log2.tmp

It's not pretty, requires keeping local data, and requires the first 2 commands to be background'ed (or run in screen or similar), but it should get the job done!

Source Link
Rain
  • 2.3k
  • 1
  • 13
  • 20

The quick and dirty way that comes to mind is to tail each log file on each remote machine and redirect them to temporary files locally. Then, tail both logs with the method golimar suggested.

  1. ssh user@host1 -C tail -f /path/to/log >> /tmp/log1.tmp
  2. ssh user@host2 -C tail -f /path/to/log >> /tmp/log2.tmp
  3. tail -q -f /tmp/log1.tmp /tmp/log2.tmp

It's not pretty, requires keeping local data, and requires the first 2 commands to be background'ed (or run in screen or similar), but it should get the job done!