Closed bcicen closed 8 years ago
Using the other slackcat, I do this:
tail -F logfile | grep --line-buffered -v '^\s*$' | slackcat
https://github.com/skattyadz/slackcat/blob/master/slackcat.go#L192-L201
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
msg := SlackMsg{
Channel: cfg.Channel,
Username: cfg.Username,
Parse: "full",
Text: scanner.Text(),
IconEmoji: cfg.IconEmoji,
}
Continuous streaming of input as preformatted messages has been added in the latest release
Add streaming option to continuously flush piped input to Slack. Something like:
tail -f /var/log/messages | slackcat --stream --channel my-channel