Created
April 24, 2017 07:36
-
-
Save moolex/e05cf5cad026f54c38844c637b413ea0 to your computer and use it in GitHub Desktop.
Tail files and send to nsq via curl (logs with json)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
tail -n0 -f $@ | | |
grep --line-buffered "" | | |
while read line; | |
do | |
echo $line && curl -s -d "{"$(echo $line | cut -d"{" -f2-) "http://127.0.0.1:4151/pub?topic=local_fs_tails" > /dev/null | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment