News for hackers. Stuff that matters.
Re:Show HN: Tail out log files from multiple remote hosts wi... by Plugawy on Sunday February 22, 2015 @03:52PM (#9091023)
So it's basically:

    tail -f <(ssh -t host 'tail -f /var/log/sth') <(ssh -t host2 'tail -f /var/log/sth')
+ I need to install nodejs?
Re:Show HN: Tail out log files from multiple remote hosts wi... by voltagex_ on Sunday February 22, 2015 @04:28PM (#9091193)
I have no problem with people writing cool little tools like this in whatever language, but there seems to be a chronic lack of understanding of what existing tools can do.
Re:Show HN: Tail out log files from multiple remote hosts wi... by SixSigma on Sunday February 22, 2015 @05:03PM (#9091355)
Henry Spencer 11/15/87

    Those who do not understand Unix are condemned to reinvent it, poorly.
Re:Show HN: Tail out log files from multiple remote hosts wi... by robbles on Sunday February 22, 2015 @06:53PM (#9091798)
The interface to this tool is far nicer to work with. Can you replicate that interface with your command?

Serious question - I actually would like to see how you'd do it.

Re:Show HN: Tail out log files from multiple remote hosts wi... by vlad003 on Sunday February 22, 2015 @08:09PM (#9092018)
You can have something like this in your .bashrc:

    multitail() {
        com="tail -f "

        for arg; do
            IFS=':' read -a array <<< "$arg"
            host="${array[0]}"
            file="${array[1]}"

            com="$com <(ssh -t $host 'tail -f $file')"
        done

        eval ${com}
    }
This will take the host:file syntax of remtail and turn it into Plugawy's example. I haven't tested it, but if you echo "$com" it'll spit out Plugawy's code.
Re:Show HN: Tail out log files from multiple remote hosts wi... by robbles on Sunday February 22, 2015 @08:36PM (#9092104)
nice solution! bash looping and arrays always seemed overly complex and confusing to me, but this is not nearly as complicated as I expected.
Re:Show HN: Tail out log files from multiple remote hosts wi... by rakoo on Sunday February 22, 2015 @03:09PM (#9090822)
For another display, there's also multitail (http://www.vanheusden.com/multitail/) that you can run with a custom command, such as

  ssh host tail -f /path/to/log
(which is the command that remtail seems to be doing)
Re:Show HN: Tail out log files from multiple remote hosts wi... by jfroma on Sunday February 22, 2015 @07:14PM (#9091859)
I use pssh [1].

  pssh -H h1 -H h2 -P "tail -n 1000 /var/log/x.log"
It is very easy to install on every platform since is on most package managers.

[1]: http://linux.die.net/man/1/pssh

Re:Show HN: Tail out log files from multiple remote hosts wi... by lobster_johnson on Sunday February 22, 2015 @08:11PM (#9092026)
pssh is great.

You'll want -i to avoid the buffered output that would make the log output hard to read.

And if your command doesn't contain anything that you need to escape from the shell, you don't need to quote the command.

And finally, since it implements BSD-style short flags correctly, so you can do "-Pi" instead of "-P -i".

Handy with a pre-defined list of hosts, too:

    pssh -Pi -H "hosts.txt" tail -f /var/log/haproxy.log
or a specific set of hosts:

    pssh -Pi -H `cat hosts.txt | grep prod` tail -f /var/log/haproxy.log
Re:Show HN: Tail out log files from multiple remote hosts wi... by jfroma on Sunday February 22, 2015 @08:21PM (#9092059)
Nice tips, thank you!
Re:Show HN: Tail out log files from multiple remote hosts wi... by ghuntley on Sunday February 22, 2015 @03:58PM (#9091053)

    > You can optionally use a credentials file in ~/.remtail.json of this format:
What ever happened to just using .netrc?

http://www.gnu.org/software/inetutils/manual/html_node/The-_...

Re:Show HN: Tail out log files from multiple remote hosts wi... by kjjw on Sunday February 22, 2015 @04:19PM (#9091154)
or ssh config?
Re:Show HN: Tail out log files from multiple remote hosts wi... by NickC_dev on Sunday February 22, 2015 @04:23PM (#9091170)
ssh config support is the first thing on the roadmap. I'd be happy to take a pull request for it.
Re:Show HN: Tail out log files from multiple remote hosts wi... by kjjw on Monday February 23, 2015 @05:05AM (#9093453)
Support would be good. I imagine a lot of people use their ssh config like I do; as a directory of servers that I have various scripts work with.
Re:Show HN: Tail out log files from multiple remote hosts wi... by fsniper on Sunday February 22, 2015 @03:33PM (#9090937)
Good implementation but not for my tastes. node.js for this purpose? I think it's a bit heavy in this case.

mssh or cluster ssh is also effective in this manner, with the added flexibility of ssh terminals.

Re:Show HN: Tail out log files from multiple remote hosts wi... by typicalbender on Sunday February 22, 2015 @12:08PM (#9090011)
I've also used dsh[1] to accomplish the same thing. Never tried to use username and password for this though so that actually may be more of a pain with dsh. Also tailing multiple files on the same host is pretty cool.

[1] - http://www.tecmint.com/using-dsh-distributed-shell-to-run-li...

Re:Show HN: Tail out log files from multiple remote hosts wi... by fidz on Sunday February 22, 2015 @08:35PM (#9092102)
In my company, we have hundred machines and tailing done with ansible. If we want customize the log view, we can simply edit the playbook. I think it is very handy compared to we need additional npm package (and not to mention additional effort for customization).
Re:Show HN: Tail out log files from multiple remote hosts wi... by dugmartin on Sunday February 22, 2015 @07:58PM (#9091990)
If you want to send that tail output to your browser here is a little app I released last week:

http://dougmart.in/projects/pagepipe