2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-24 12:11:52 +00:00

Handle events without timestamps

If an event is missing a timestamp, omit rather than stack trace
This commit is contained in:
Jarrod Johnson 2016-10-11 16:46:01 -04:00
parent 2efadf21b5
commit 7f9394b33a

View File

@ -45,7 +45,7 @@ exitcode = 0
def format_event(evt):
retparts = []
if 'timestamp' in evt:
if 'timestamp' in evt and evt['timestamp'] is not None:
display = dt.strptime(evt['timestamp'], '%Y-%m-%dT%H:%M:%S')
retparts.append(display.strftime('%m/%d/%Y %H:%M:%S'))
dscparts = []