Privacy Policy
Snippets index

  Distributed shell and other commands to collect remote logs

Examples

Simple use of ssh to show remote logs files:

ssh user@hostname1 "tail -f /var/log/*.log"

Collecting logs from remote machines using multitail:

multitail -l 'ssh user@host1 "tail -f /some/log/file"' -l 'ssh user@host2 "tail -f /some/log/file"'

Probably the lightest-weight solution for real-time log watching is to use Dancer's shell in concurrent mode with tail -f:

dsh -Mac -- tail -f /var/log/apache/*.log
The -a is for all machine names that you've defined in ~/.dsh/machines.list
The -c is for concurrent running of tail
The -M prepends the hostname to every line of output.