Skip to content

Instantly share code, notes, and snippets.

@davidonet
Last active November 5, 2015 05:30
Show Gist options
  • Save davidonet/8d8461db8a0b6720c9f1 to your computer and use it in GitHub Desktop.
Save davidonet/8d8461db8a0b6720c9f1 to your computer and use it in GitHub Desktop.
Gelf IP logging
IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
MSG=\{\"short_message\":\"heartbeat\",\"host\":\"host\",\"address\":\"$IP\"\}
curl -XPOST http://gelf.logging.com/gelf -p0 -d $MSG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment