Skip to content

Instantly share code, notes, and snippets.

@aronbudinszky
Created October 9, 2019 21:46
Show Gist options
  • Save aronbudinszky/c50a8e0737ca3d267e21e5fa13099009 to your computer and use it in GitHub Desktop.
Save aronbudinszky/c50a8e0737ca3d267e21e5fa13099009 to your computer and use it in GitHub Desktop.
An script for streaming log file contents into Basecamp Campfire.
#!/bin/bash
tail -n0 -F "$1" | while read LINE; do
(echo "$LINE" | grep -e "$3") && curl -X POST --silent --data-urlencode \
"content=$(echo $LINE)" "$2";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment