We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 896e34b + 5b665c2 commit dc33683Copy full SHA for dc33683
logstash_formatter/__init__.py
@@ -142,7 +142,8 @@ def format(self, record):
142
if 'exc_text' in fields and not fields['exc_text']:
143
fields.pop('exc_text')
144
145
- base_log = {'@timestamp': datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
+ now = datetime.datetime.utcnow()
146
+ base_log = {'@timestamp': now.strftime("%Y-%m-%dT%H:%M:%S") + ".%03d" % (now.microsecond / 1000) + "Z",
147
'@version': 1,
148
'source_host': self.source_host}
149
base_log.update(fields)
0 commit comments