Skip to content

Instantly share code, notes, and snippets.

@lhsfcboy
Created January 29, 2018 07:29
Show Gist options
  • Save lhsfcboy/755dfb306ee7142266588f9ba2e85e01 to your computer and use it in GitHub Desktop.
Save lhsfcboy/755dfb306ee7142266588f9ba2e85e01 to your computer and use it in GitHub Desktop.
读取log文件并过滤, 之后发布到slack频道里
tail -n0 -F logs/lastest.log | grep --line-buffered INFO| xargs -I @ curl -s \
https://hooks.slack.com/AAAAAAAA/BBBBBBB/CCCCCC \
-X POST \
-H 'Content-type: application/json' \
--data '{"username":"curl", "text":"@"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment