From 8a9a796ca002ad27cea6db266cb07237448b4204 Mon Sep 17 00:00:00 2001 From: oliverdrake Date: Tue, 15 Jan 2013 16:02:34 +1300 Subject: [PATCH] Hierarchical logger names are now split by decimal points into separate tags. Full logger name added to logstash message under @source_path --- pylogstash/handler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pylogstash/handler.py b/pylogstash/handler.py index dd921aa..754b5c9 100644 --- a/pylogstash/handler.py +++ b/pylogstash/handler.py @@ -39,12 +39,13 @@ def emit(self, record): tags = [] tags.extend(self._tags) tags.append('pylogstash') - tags.append(record.name) + tags.extend(record.name.split(".")) timestamp = datetime.datetime.utcfromtimestamp(record.created).isoformat() field_dict['timestamp'] = timestamp host = socket.gethostname() message = { "@source": record.filename, + "@source_path": record.name, "@tags": tags, "@timestamp": timestamp, "@type": self._input_type, @@ -52,6 +53,4 @@ def emit(self, record): "@source_host": host, "@message": self.format(record) } - print("Shipping log") self.publisher.send_json(message) - print("message shipped")