diff --git a/src/diamond/handler/logentries_diamond.py b/src/diamond/handler/logentries_diamond.py index d3fc9ccff..88c78ffd4 100644 --- a/src/diamond/handler/logentries_diamond.py +++ b/src/diamond/handler/logentries_diamond.py @@ -28,9 +28,11 @@ class LogentriesDiamondHandler(Handler): + """ Implements the abstract Handler class """ + def __init__(self, config=None): """ New instance of LogentriesDiamondHandler class @@ -87,7 +89,11 @@ def _send(self): while len(self.queue) > 0: metric = self.queue.popleft() topic, value, timestamp = str(metric).split() - msg = json.dumps({"event": {topic: value}}) + # Remove Host Name from topic path + topic = topic.replace("." + metric.host, "") + msg = json.dumps( + {"event": {"Timestamp": timestamp, "Host": metric.host, + topic: value, }}) req = urllib2.Request("https://js.logentries.com/v1/logs/" + self.log_token, msg) try: