Distributed grep client in Go
github.com
github.com
How long have you been writing in it? I have an idea for autility id like to implement in it for a bit of fun.
cmd := exec.Command("grep", s, logName)
Since you are searching for the expression in just one log file, why not use Go's excellent regexp package?You could (for instance) probe content of system files by passing
-f/some/file
And matching that to the log. If you have some control over the log, you could use this to read content from system files. Of course, it's all indirect, since the file is interpreted as containing regular expressions. But it's certainly not 'perfectly safe'.I don't see what this has to do with exec.Command.
Using ssh instead of running a service on each server seems more straightforward to my thinking.