Skip to content

Instantly share code, notes, and snippets.

@davidonet
Created January 17, 2014 16:33
Show Gist options
  • Save davidonet/8476481 to your computer and use it in GitHub Desktop.
Save davidonet/8476481 to your computer and use it in GitHub Desktop.
sending ip to Graylog2
#!/bin/sh
IP=`ip -f inet -o address show enp1s0f0 | awk '{print $4}'`
echo '{"version": "1.1","host":"'$HOSTNAME'","short_message":"ip","level":4,"_ip":"'$IP'"}' | nc -w 1 -u <server_address> 12201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment