Created
March 19, 2015 12:55
-
-
Save rsff/4203b764adb409945257 to your computer and use it in GitHub Desktop.
send data to graylog testing GELF
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
import json | |
import urllib2 | |
import socket | |
graydata = json.loads(open('/tmp/json.out').read()) | |
val = graydata['general'] | |
val["short_message"] = socket.gethostname()+ " access statistics"+" from "+val["log_file"] | |
val["host"] = socket.gethostname() | |
json_data = json.dumps(val) | |
urllib2.urlopen("http://url.pt:1943/gelf", json_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment