Skip to content

Instantly share code, notes, and snippets.

@k9ert
Created February 9, 2015 07:19
Show Gist options
  • Save k9ert/18fce5fc99f389c5dacc to your computer and use it in GitHub Desktop.
Save k9ert/18fce5fc99f389c5dacc to your computer and use it in GitHub Desktop.
Passing the number of some errormessages to graphite daily
#!/bin/bash
PORT=2003
SERVER=graphite.yourcompany.com
yesterday=`date --date="yesterday" +%Y-%m-%d`
counter=`less /some/log/file/program-${yesterday}.log | grep "An errormessage" | wc -l`
#echo "echoing $counter"
echo "com.hybris.fra.yrd.stash.logging.crowdunavailable $counter `date +%s` " | nc -q 2 ${SERVER} ${PORT};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment