From 4fb6f3ea59c52515926a51a006e65a1c18e57720 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 5 Jan 2021 21:51:30 -0800 Subject: [PATCH] add support for down in addition to crash --- jc/parsers/last.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jc/parsers/last.py b/jc/parsers/last.py index 668c1682..39f04f9c 100644 --- a/jc/parsers/last.py +++ b/jc/parsers/last.py @@ -194,10 +194,10 @@ def parse(data, raw=False, quiet=False): if re.match(r'\d\d:\d\d:\d\d \d\d\d\d', ' '.join(linedata[6:8])): output_line['login'] = ' '.join(linedata[3:8]) - if len(linedata) > 9 and linedata[9] != 'crash': + if len(linedata) > 9 and linedata[9] != 'crash' and linedata[9] != 'down': output_line['logout'] = ' '.join(linedata[9:14]) - if len(linedata) > 9 and linedata[9] == 'crash': + if len(linedata) > 9 and (linedata[9] == 'crash' or linedata[9] == 'down'): output_line['logout'] = linedata[9] # add more items to the list to line up duration linedata.insert(10, '-')