diff --git a/jc/parsers/last.py b/jc/parsers/last.py index bb40404b..668c1682 100644 --- a/jc/parsers/last.py +++ b/jc/parsers/last.py @@ -194,9 +194,17 @@ 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: + if len(linedata) > 9 and linedata[9] != 'crash': output_line['logout'] = ' '.join(linedata[9:14]) + if len(linedata) > 9 and linedata[9] == 'crash': + output_line['logout'] = linedata[9] + # add more items to the list to line up duration + linedata.insert(10, '-') + linedata.insert(10, '-') + linedata.insert(10, '-') + linedata.insert(10, '-') + if len(linedata) > 14: output_line['duration'] = linedata[14].replace('(', '').replace(')', '') diff --git a/tests/fixtures/centos-7.7/last-crash.json b/tests/fixtures/centos-7.7/last-crash.json new file mode 100644 index 00000000..46877f97 --- /dev/null +++ b/tests/fixtures/centos-7.7/last-crash.json @@ -0,0 +1 @@ +[{"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Tue Jan 5 14:29", "logout": "still logged in"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jan 5 14:28", "logout": "still logged in"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Jan 5 14:28", "logout": "14:35", "duration": "00:07"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Jan 4 12:29", "logout": "crash", "duration": "1+01:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Jan 4 12:11", "logout": "14:35", "duration": "1+02:24"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Wed Dec 30 11:12", "logout": "crash", "duration": "5+00:58"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Dec 30 10:59", "logout": "14:35", "duration": "6+03:35"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Tue Dec 29 10:14", "logout": "crash", "duration": "1+00:45"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Dec 29 10:11", "logout": "crash", "duration": "1+00:48"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Dec 29 10:11", "logout": "14:35", "duration": "7+04:24"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Wed Aug 12 15:21", "logout": "crash", "duration": "138+19:49"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed Aug 12 15:08", "logout": "crash", "duration": "138+20:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Aug 12 15:07", "logout": "14:35", "duration": "146+00:28"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Tue Aug 4 09:39", "logout": "crash", "duration": "8+05:27"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Aug 4 09:39", "logout": "crash", "duration": "8+05:28"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Aug 4 09:30", "logout": "14:35", "duration": "154+06:05"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Sat Aug 1 08:58", "logout": "crash", "duration": "3+00:32"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Jul 31 13:55", "logout": "crash", "duration": "3+19:34"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Jul 31 13:55", "logout": "14:35", "duration": "158+01:40"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Thu Jul 30 08:34", "logout": "crash", "duration": "1+05:21"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Thu Jul 30 08:31", "logout": "crash", "duration": "1+05:24"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu Jul 30 08:31", "logout": "14:35", "duration": "159+07:04"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Tue Jul 28 19:23", "logout": "crash", "duration": "1+13:07"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jul 28 19:23", "logout": "crash", "duration": "1+13:07"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Jul 28 19:22", "logout": "14:35", "duration": "160+20:13"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Tue Jul 28 16:27", "logout": "crash", "duration": "02:54"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jul 28 16:27", "logout": "crash", "duration": "02:55"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Jul 28 13:22", "logout": "14:35", "duration": "161+02:13"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Tue Jul 28 00:13", "logout": "crash", "duration": "13:08"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Mon Jul 27 20:23", "logout": "00:13", "duration": "03:49"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Jul 27 20:23", "logout": "crash", "duration": "16:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Jul 27 20:04", "logout": "14:35", "duration": "161+19:31"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Tue Jul 21 09:15", "logout": "crash", "duration": "6+10:49"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jul 21 09:15", "logout": "crash", "duration": "6+10:49"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Jul 21 09:14", "logout": "14:35", "duration": "168+06:21"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "kbrazil-mac.attl", "login": "Fri Jul 17 19:12", "logout": "19:13", "duration": "00:00"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri Jul 17 15:49", "logout": "crash", "duration": "3+17:25"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Jul 17 15:48", "logout": "crash", "duration": "3+17:26"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Jul 17 15:48", "logout": "14:35", "duration": "171+23:47"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attl", "login": "Fri Jul 17 01:52", "logout": "crash", "duration": "13:56"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Thu Jul 16 14:48", "logout": "crash", "duration": "1+00:59"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Thu Jul 16 14:10", "logout": "16:26", "duration": "02:15"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Thu Jul 16 14:09", "logout": "crash", "duration": "1+01:38"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu Jul 16 08:35", "logout": "14:35", "duration": "173+07:00"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Jul 8 13:44", "logout": "crash", "duration": "7+18:50"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed Jul 8 13:12", "logout": "crash", "duration": "7+19:22"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Jul 8 11:27", "logout": "14:35", "duration": "181+04:08"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Jun 26 11:53", "logout": "crash", "duration": "11+23:33"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Jun 26 11:52", "logout": "14:35", "duration": "193+03:43"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Jun 23 15:23", "logout": "15:27", "duration": "00:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Jun 23 15:23", "logout": "15:27", "duration": "00:04"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri Jun 19 10:47", "logout": "crash", "duration": "4+04:36"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Jun 19 10:46", "logout": "crash", "duration": "4+04:36"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Jun 19 10:29", "logout": "15:27", "duration": "4+04:58"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Mon Jun 8 10:30", "logout": "crash", "duration": "10+23:58"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Jun 8 10:30", "logout": "crash", "duration": "10+23:58"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Jun 8 10:30", "logout": "15:27", "duration": "15+04:57"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Jun 2 12:05", "logout": "15:27", "duration": "21+03:21"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Tue Jun 2 08:38", "logout": "crash", "duration": "03:26"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jun 2 08:38", "logout": "crash", "duration": "03:27"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Jun 2 06:13", "logout": "15:27", "duration": "21+09:13"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sun May 24 16:10", "logout": "17:18", "duration": "01:08"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Sun May 24 15:34", "logout": "crash", "duration": "8+14:39"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Sun May 24 15:34", "logout": "15:27", "duration": "29+23:53"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Fri May 22 13:39", "logout": "crash", "duration": "2+01:54"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri May 22 13:11", "logout": "crash", "duration": "2+02:22"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri May 22 13:10", "logout": "crash", "duration": "2+02:23"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri May 22 12:49", "logout": "15:27", "duration": "32+02:37"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri May 22 08:44", "logout": "crash", "duration": "04:05"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri May 22 08:44", "logout": "crash", "duration": "04:05"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri May 22 08:43", "logout": "15:27", "duration": "32+06:43"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Thu May 14 16:39", "logout": "crash", "duration": "7+16:04"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu May 14 16:39", "logout": "15:27", "duration": "39+22:48"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Wed May 13 10:23", "logout": "crash", "duration": "1+06:15"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed May 13 10:22", "logout": "crash", "duration": "1+06:16"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed May 13 09:51", "logout": "15:27", "duration": "41+05:35"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Wed Apr 15 13:00", "logout": "crash", "duration": "27+20:51"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Wed Apr 15 12:38", "logout": "13:01", "duration": "00:22"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed Apr 15 12:28", "logout": "20:44", "duration": "08:15"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Apr 15 04:02", "logout": "15:27", "duration": "69+11:25"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Apr 14 16:02", "logout": "crash", "duration": "11:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Apr 14 16:02", "logout": "15:27", "duration": "69+23:25"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Apr 14 08:44", "logout": "10:00", "duration": "01:16"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Apr 14 06:57", "logout": "08:44", "duration": "01:47"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Apr 14 06:56", "logout": "15:27", "duration": "70+08:31"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Apr 7 17:33", "logout": "crash", "duration": "6+13:22"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Apr 6 21:22", "logout": "22:42", "duration": "01:19"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Apr 6 19:43", "logout": "19:45", "duration": "00:01"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Apr 4 17:31", "logout": "crash", "duration": "9+13:24"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Sat Apr 4 17:17", "logout": "15:27", "duration": "79+22:10"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sun Mar 29 12:42", "logout": "crash", "duration": "6+04:34"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 24 11:21", "logout": "12:42", "duration": "5+01:20"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 24 11:18", "logout": "11:21", "duration": "00:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Mar 24 10:57", "logout": "15:27", "duration": "91+04:30"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 17 06:56", "logout": "crash", "duration": "7+04:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Mar 17 05:12", "logout": "15:27", "duration": "98+10:15"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Mar 12 10:12", "logout": "crash", "duration": "4+18:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu Mar 12 09:22", "logout": "15:27", "duration": "103+06:05"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Mar 11 13:29", "logout": "crash", "duration": "19:52"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Mar 11 12:19", "logout": "15:27", "duration": "104+03:07"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 10 17:53", "logout": "crash", "duration": "18:26"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Mar 10 17:52", "logout": "15:27", "duration": "104+21:34"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 10 13:09", "logout": "crash", "duration": "04:43"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Mar 10 13:08", "logout": "15:27", "duration": "105+02:18"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Mar 7 18:13", "logout": "crash", "duration": "2+17:55"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Sat Mar 7 18:13", "logout": "15:27", "duration": "107+20:14"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Mar 5 14:48", "logout": "crash", "duration": "2+03:24"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu Mar 5 03:02", "logout": "15:27", "duration": "110+11:25"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Mar 2 19:53", "logout": "crash", "duration": "2+07:08"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Mar 2 19:53", "logout": "15:27", "duration": "112+18:34"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Feb 29 18:43", "logout": "crash", "duration": "2+01:09"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Sat Feb 29 18:08", "logout": "18:28", "duration": "00:20"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Feb 29 15:16", "logout": "18:42", "duration": "03:26"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Feb 29 12:14", "logout": "crash", "duration": "2+07:38"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Sat Feb 29 12:13", "logout": "15:27", "duration": "115+02:13"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Feb 28 13:49", "logout": "crash", "duration": "22:23"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Feb 28 12:56", "logout": "15:27", "duration": "116+01:31"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 27 16:01", "logout": "crash", "duration": "20:54"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu Feb 27 15:51", "logout": "15:27", "duration": "116+22:35"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 27 10:50", "logout": "crash", "duration": "05:01"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Feb 26 20:05", "logout": "15:27", "duration": "117+18:22"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 20 14:42", "logout": "crash", "duration": "6+05:23"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu Feb 20 14:41", "logout": "15:27", "duration": "123+23:45"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Feb 17 17:48", "logout": "crash", "duration": "2+20:52"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Feb 17 17:48", "logout": "15:27", "duration": "126+20:38"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 13 16:44", "logout": "crash", "duration": "4+01:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Thu Feb 13 16:44", "logout": "15:27", "duration": "130+21:42"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Feb 5 14:23", "logout": "crash", "duration": "8+02:20"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Feb 5 11:43", "logout": "15:27", "duration": "139+02:44"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Feb 4 14:28", "logout": "crash", "duration": "21:15"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Feb 4 01:28", "logout": "15:27", "duration": "140+12:59"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Jan 13 17:28", "logout": "crash", "duration": "21+07:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Jan 13 16:16", "logout": "15:27", "duration": "161+22:11"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Dec 16 11:15", "logout": "crash", "duration": "28+05:01"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Dec 16 11:14", "logout": "15:27", "duration": "190+03:12"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Dec 4 21:41", "logout": "crash", "duration": "11+13:33"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Wed Dec 4 21:40", "logout": "15:27", "duration": "201+16:46"}, {"user": "kbrazil", "tty": "pts/1", "hostname": null, "login": "Sat Nov 16 14:40", "logout": "14:40", "duration": "00:00"}, {"user": "kbrazil", "tty": "pts/1", "hostname": null, "login": "Sat Nov 16 14:39", "logout": "14:39", "duration": "00:00"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "localhost", "login": "Tue Nov 12 07:19", "logout": "crash", "duration": "22+14:21"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Nov 12 07:18", "logout": "crash", "duration": "22+14:22"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "localhost", "login": "Sun Nov 10 08:21", "logout": "15:22", "duration": "1+07:01"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Nov 9 10:34", "logout": "07:16", "duration": "2+20:42"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Sat Nov 9 10:34", "logout": "15:27", "duration": "227+03:53"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Nov 8 07:49", "logout": "crash", "duration": "1+02:45"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri Nov 8 06:29", "logout": "crash", "duration": "1+04:04"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Nov 8 06:24", "logout": "crash", "duration": "1+04:09"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Nov 8 06:14", "logout": "15:27", "duration": "228+08:13"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Sun Nov 3 12:20", "logout": "crash", "duration": "4+17:54"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sun Nov 3 11:04", "logout": "11:05", "duration": "00:01"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Nov 2 19:26", "logout": "crash", "duration": "5+11:47"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Nov 1 15:14", "logout": "11:03", "duration": "1+20:49"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Nov 1 15:13", "logout": "15:27", "duration": "235+00:14"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Nov 1 11:16", "logout": "11:36", "duration": "00:20"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Nov 1 06:00", "logout": "11:36", "duration": "05:36"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Oct 29 18:17", "logout": "crash", "duration": "2+11:43"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Tue Oct 29 18:16", "logout": "11:36", "duration": "2+17:19"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Oct 26 09:53", "logout": "15:13", "duration": "05:19"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Oct 25 18:22", "logout": "crash", "duration": "3+23:54"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Oct 25 18:21", "logout": "11:36", "duration": "6+17:14"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Oct 25 17:14", "logout": "18:21", "duration": "01:06"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Oct 25 17:13", "logout": "11:36", "duration": "6+18:22"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Oct 25 15:43", "logout": "17:13", "duration": "01:29"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Fri Oct 25 13:29", "logout": "17:13", "duration": "03:44"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Oct 21 13:19", "logout": "19:22", "duration": "2+06:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.", "login": "Mon Oct 21 13:17", "logout": "19:22", "duration": "2+06:05"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Oct 16 03:23", "logout": "crash", "duration": "5+09:54"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Oct 15 16:49", "logout": "03:23", "duration": "10:34"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Oct 15 10:39", "logout": "16:48", "duration": "06:09"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.", "login": "Tue Oct 15 10:39", "logout": "19:22", "duration": "8+08:43"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 16:05", "logout": "16:05", "duration": "00:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.", "login": "Thu Aug 15 16:05", "logout": "16:05", "duration": "00:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.", "login": "Thu Aug 15 16:00", "logout": "16:05", "duration": "00:05"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 14:25", "logout": "crash", "duration": "01:35"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.", "login": "Thu Aug 15 14:24", "logout": "16:05", "duration": "01:41"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 11:58", "logout": "crash", "duration": "02:25"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.el7.x", "login": "Thu Aug 15 11:58", "logout": "16:05", "duration": "04:07"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 11:57", "logout": "11:57", "duration": "00:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.el7.x", "login": "Thu Aug 15 11:57", "logout": "16:05", "duration": "04:08"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Thu Aug 15 10:58", "logout": "11:56", "duration": "00:58"}, {"user": "root", "tty": "tty1", "hostname": null, "login": "Thu Aug 15 10:57", "logout": "11:56", "duration": "00:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.el7.x", "login": "Thu Aug 15 10:57", "logout": "11:56", "duration": "00:59"}] diff --git a/tests/fixtures/centos-7.7/last-crash.out b/tests/fixtures/centos-7.7/last-crash.out new file mode 100644 index 00000000..4e88ab96 --- /dev/null +++ b/tests/fixtures/centos-7.7/last-crash.out @@ -0,0 +1,184 @@ +kbrazil pts/0 kbrazil-mac.attl Tue Jan 5 14:29 still logged in +kbrazil tty1 Tue Jan 5 14:28 still logged in +reboot system boot 3.10.0-1062.1.2. Tue Jan 5 14:28 - 14:35 (00:07) +kbrazil tty1 Mon Jan 4 12:29 - crash (1+01:59) +reboot system boot 3.10.0-1062.1.2. Mon Jan 4 12:11 - 14:35 (1+02:24) +kbrazil pts/0 kbrazil-mac.attl Wed Dec 30 11:12 - crash (5+00:58) +reboot system boot 3.10.0-1062.1.2. Wed Dec 30 10:59 - 14:35 (6+03:35) +kbrazil pts/0 kbrazil-mac.attl Tue Dec 29 10:14 - crash (1+00:45) +kbrazil tty1 Tue Dec 29 10:11 - crash (1+00:48) +reboot system boot 3.10.0-1062.1.2. Tue Dec 29 10:11 - 14:35 (7+04:24) +kbrazil pts/0 kbrazil-mac.attl Wed Aug 12 15:21 - crash (138+19:49) +kbrazil tty1 Wed Aug 12 15:08 - crash (138+20:03) +reboot system boot 3.10.0-1062.1.2. Wed Aug 12 15:07 - 14:35 (146+00:28) +kbrazil pts/0 kbrazil-mac.attl Tue Aug 4 09:39 - crash (8+05:27) +kbrazil tty1 Tue Aug 4 09:39 - crash (8+05:28) +reboot system boot 3.10.0-1062.1.2. Tue Aug 4 09:30 - 14:35 (154+06:05) +kbrazil pts/0 kbrazil-mac.attl Sat Aug 1 08:58 - crash (3+00:32) +kbrazil tty1 Fri Jul 31 13:55 - crash (3+19:34) +reboot system boot 3.10.0-1062.1.2. Fri Jul 31 13:55 - 14:35 (158+01:40) +kbrazil pts/0 kbrazil-mac.attl Thu Jul 30 08:34 - crash (1+05:21) +kbrazil tty1 Thu Jul 30 08:31 - crash (1+05:24) +reboot system boot 3.10.0-1062.1.2. Thu Jul 30 08:31 - 14:35 (159+07:04) +kbrazil pts/0 kbrazil-mac.attl Tue Jul 28 19:23 - crash (1+13:07) +kbrazil tty1 Tue Jul 28 19:23 - crash (1+13:07) +reboot system boot 3.10.0-1062.1.2. Tue Jul 28 19:22 - 14:35 (160+20:13) +kbrazil pts/0 kbrazil-mac.attl Tue Jul 28 16:27 - crash (02:54) +kbrazil tty1 Tue Jul 28 16:27 - crash (02:55) +reboot system boot 3.10.0-1062.1.2. Tue Jul 28 13:22 - 14:35 (161+02:13) +kbrazil pts/0 kbrazil-mac.attl Tue Jul 28 00:13 - crash (13:08) +kbrazil pts/0 kbrazil-mac.attl Mon Jul 27 20:23 - 00:13 (03:49) +kbrazil tty1 Mon Jul 27 20:23 - crash (16:59) +reboot system boot 3.10.0-1062.1.2. Mon Jul 27 20:04 - 14:35 (161+19:31) +kbrazil pts/0 kbrazil-mac.attl Tue Jul 21 09:15 - crash (6+10:49) +kbrazil tty1 Tue Jul 21 09:15 - crash (6+10:49) +reboot system boot 3.10.0-1062.1.2. Tue Jul 21 09:14 - 14:35 (168+06:21) +kbrazil pts/1 kbrazil-mac.attl Fri Jul 17 19:12 - 19:13 (00:00) +kbrazil pts/0 192.168.71.1 Fri Jul 17 15:49 - crash (3+17:25) +kbrazil tty1 Fri Jul 17 15:48 - crash (3+17:26) +reboot system boot 3.10.0-1062.1.2. Fri Jul 17 15:48 - 14:35 (171+23:47) +kbrazil pts/0 kbrazil-mac.attl Fri Jul 17 01:52 - crash (13:56) +kbrazil pts/1 192.168.71.1 Thu Jul 16 14:48 - crash (1+00:59) +kbrazil pts/0 192.168.71.1 Thu Jul 16 14:10 - 16:26 (02:15) +kbrazil tty1 Thu Jul 16 14:09 - crash (1+01:38) +reboot system boot 3.10.0-1062.1.2. Thu Jul 16 08:35 - 14:35 (173+07:00) +kbrazil ttyS0 Wed Jul 8 13:44 - crash (7+18:50) +kbrazil tty1 Wed Jul 8 13:12 - crash (7+19:22) +reboot system boot 3.10.0-1062.1.2. Wed Jul 8 11:27 - 14:35 (181+04:08) +kbrazil ttyS0 Fri Jun 26 11:53 - crash (11+23:33) +reboot system boot 3.10.0-1062.1.2. Fri Jun 26 11:52 - 14:35 (193+03:43) +kbrazil ttyS0 Tue Jun 23 15:23 - 15:27 (00:03) +reboot system boot 3.10.0-1062.1.2. Tue Jun 23 15:23 - 15:27 (00:04) +kbrazil pts/0 192.168.71.1 Fri Jun 19 10:47 - crash (4+04:36) +kbrazil tty1 Fri Jun 19 10:46 - crash (4+04:36) +reboot system boot 3.10.0-1062.1.2. Fri Jun 19 10:29 - 15:27 (4+04:58) +kbrazil pts/0 192.168.71.1 Mon Jun 8 10:30 - crash (10+23:58) +kbrazil tty1 Mon Jun 8 10:30 - crash (10+23:58) +reboot system boot 3.10.0-1062.1.2. Mon Jun 8 10:30 - 15:27 (15+04:57) +reboot system boot 3.10.0-1062.1.2. Tue Jun 2 12:05 - 15:27 (21+03:21) +kbrazil pts/0 192.168.71.1 Tue Jun 2 08:38 - crash (03:26) +kbrazil tty1 Tue Jun 2 08:38 - crash (03:27) +reboot system boot 3.10.0-1062.1.2. Tue Jun 2 06:13 - 15:27 (21+09:13) +kbrazil pts/0 192.168.71.1 Sun May 24 16:10 - 17:18 (01:08) +kbrazil tty1 Sun May 24 15:34 - crash (8+14:39) +reboot system boot 3.10.0-1062.1.2. Sun May 24 15:34 - 15:27 (29+23:53) +kbrazil pts/1 192.168.71.1 Fri May 22 13:39 - crash (2+01:54) +kbrazil pts/0 192.168.71.1 Fri May 22 13:11 - crash (2+02:22) +kbrazil tty1 Fri May 22 13:10 - crash (2+02:23) +reboot system boot 3.10.0-1062.1.2. Fri May 22 12:49 - 15:27 (32+02:37) +kbrazil pts/0 192.168.71.1 Fri May 22 08:44 - crash (04:05) +kbrazil tty1 Fri May 22 08:44 - crash (04:05) +reboot system boot 3.10.0-1062.1.2. Fri May 22 08:43 - 15:27 (32+06:43) +kbrazil tty1 Thu May 14 16:39 - crash (7+16:04) +reboot system boot 3.10.0-1062.1.2. Thu May 14 16:39 - 15:27 (39+22:48) +kbrazil pts/0 192.168.71.1 Wed May 13 10:23 - crash (1+06:15) +kbrazil tty1 Wed May 13 10:22 - crash (1+06:16) +reboot system boot 3.10.0-1062.1.2. Wed May 13 09:51 - 15:27 (41+05:35) +kbrazil pts/1 192.168.71.1 Wed Apr 15 13:00 - crash (27+20:51) +kbrazil pts/0 192.168.71.1 Wed Apr 15 12:38 - 13:01 (00:22) +kbrazil tty1 Wed Apr 15 12:28 - 20:44 (08:15) +reboot system boot 3.10.0-1062.1.2. Wed Apr 15 04:02 - 15:27 (69+11:25) +kbrazil ttyS0 Tue Apr 14 16:02 - crash (11:59) +reboot system boot 3.10.0-1062.1.2. Tue Apr 14 16:02 - 15:27 (69+23:25) +kbrazil ttyS0 Tue Apr 14 08:44 - 10:00 (01:16) +kbrazil ttyS0 Tue Apr 14 06:57 - 08:44 (01:47) +reboot system boot 3.10.0-1062.1.2. Tue Apr 14 06:56 - 15:27 (70+08:31) +kbrazil tty1 Tue Apr 7 17:33 - crash (6+13:22) +kbrazil tty1 Mon Apr 6 21:22 - 22:42 (01:19) +kbrazil tty1 Mon Apr 6 19:43 - 19:45 (00:01) +kbrazil ttyS0 Sat Apr 4 17:31 - crash (9+13:24) +reboot system boot 3.10.0-1062.1.2. Sat Apr 4 17:17 - 15:27 (79+22:10) +kbrazil ttyS0 Sun Mar 29 12:42 - crash (6+04:34) +kbrazil ttyS0 Tue Mar 24 11:21 - 12:42 (5+01:20) +kbrazil ttyS0 Tue Mar 24 11:18 - 11:21 (00:03) +reboot system boot 3.10.0-1062.1.2. Tue Mar 24 10:57 - 15:27 (91+04:30) +kbrazil ttyS0 Tue Mar 17 06:56 - crash (7+04:00) +reboot system boot 3.10.0-1062.1.2. Tue Mar 17 05:12 - 15:27 (98+10:15) +kbrazil ttyS0 Thu Mar 12 10:12 - crash (4+18:59) +reboot system boot 3.10.0-1062.1.2. Thu Mar 12 09:22 - 15:27 (103+06:05) +kbrazil ttyS0 Wed Mar 11 13:29 - crash (19:52) +reboot system boot 3.10.0-1062.1.2. Wed Mar 11 12:19 - 15:27 (104+03:07) +kbrazil ttyS0 Tue Mar 10 17:53 - crash (18:26) +reboot system boot 3.10.0-1062.1.2. Tue Mar 10 17:52 - 15:27 (104+21:34) +kbrazil ttyS0 Tue Mar 10 13:09 - crash (04:43) +reboot system boot 3.10.0-1062.1.2. Tue Mar 10 13:08 - 15:27 (105+02:18) +kbrazil ttyS0 Sat Mar 7 18:13 - crash (2+17:55) +reboot system boot 3.10.0-1062.1.2. Sat Mar 7 18:13 - 15:27 (107+20:14) +kbrazil ttyS0 Thu Mar 5 14:48 - crash (2+03:24) +reboot system boot 3.10.0-1062.1.2. Thu Mar 5 03:02 - 15:27 (110+11:25) +kbrazil ttyS0 Mon Mar 2 19:53 - crash (2+07:08) +reboot system boot 3.10.0-1062.1.2. Mon Mar 2 19:53 - 15:27 (112+18:34) +kbrazil pts/0 192.168.71.1 Sat Feb 29 18:43 - crash (2+01:09) +kbrazil pts/1 192.168.71.1 Sat Feb 29 18:08 - 18:28 (00:20) +kbrazil pts/0 192.168.71.1 Sat Feb 29 15:16 - 18:42 (03:26) +kbrazil ttyS0 Sat Feb 29 12:14 - crash (2+07:38) +reboot system boot 3.10.0-1062.1.2. Sat Feb 29 12:13 - 15:27 (115+02:13) +kbrazil ttyS0 Fri Feb 28 13:49 - crash (22:23) +reboot system boot 3.10.0-1062.1.2. Fri Feb 28 12:56 - 15:27 (116+01:31) +kbrazil ttyS0 Thu Feb 27 16:01 - crash (20:54) +reboot system boot 3.10.0-1062.1.2. Thu Feb 27 15:51 - 15:27 (116+22:35) +kbrazil ttyS0 Thu Feb 27 10:50 - crash (05:01) +reboot system boot 3.10.0-1062.1.2. Wed Feb 26 20:05 - 15:27 (117+18:22) +kbrazil ttyS0 Thu Feb 20 14:42 - crash (6+05:23) +reboot system boot 3.10.0-1062.1.2. Thu Feb 20 14:41 - 15:27 (123+23:45) +kbrazil ttyS0 Mon Feb 17 17:48 - crash (2+20:52) +reboot system boot 3.10.0-1062.1.2. Mon Feb 17 17:48 - 15:27 (126+20:38) +kbrazil ttyS0 Thu Feb 13 16:44 - crash (4+01:03) +reboot system boot 3.10.0-1062.1.2. Thu Feb 13 16:44 - 15:27 (130+21:42) +kbrazil ttyS0 Wed Feb 5 14:23 - crash (8+02:20) +reboot system boot 3.10.0-1062.1.2. Wed Feb 5 11:43 - 15:27 (139+02:44) +kbrazil ttyS0 Tue Feb 4 14:28 - crash (21:15) +reboot system boot 3.10.0-1062.1.2. Tue Feb 4 01:28 - 15:27 (140+12:59) +kbrazil ttyS0 Mon Jan 13 17:28 - crash (21+07:59) +reboot system boot 3.10.0-1062.1.2. Mon Jan 13 16:16 - 15:27 (161+22:11) +kbrazil ttyS0 Mon Dec 16 11:15 - crash (28+05:01) +reboot system boot 3.10.0-1062.1.2. Mon Dec 16 11:14 - 15:27 (190+03:12) +kbrazil ttyS0 Wed Dec 4 21:41 - crash (11+13:33) +reboot system boot 3.10.0-1062.1.2. Wed Dec 4 21:40 - 15:27 (201+16:46) +kbrazil pts/1 Sat Nov 16 14:40 - 14:40 (00:00) +kbrazil pts/1 Sat Nov 16 14:39 - 14:39 (00:00) +kbrazil pts/0 localhost Tue Nov 12 07:19 - crash (22+14:21) +kbrazil ttyS0 Tue Nov 12 07:18 - crash (22+14:22) +kbrazil pts/0 localhost Sun Nov 10 08:21 - 15:22 (1+07:01) +kbrazil ttyS0 Sat Nov 9 10:34 - 07:16 (2+20:42) +reboot system boot 3.10.0-1062.1.2. Sat Nov 9 10:34 - 15:27 (227+03:53) +kbrazil tty1 Fri Nov 8 07:49 - crash (1+02:45) +kbrazil pts/0 192.168.71.1 Fri Nov 8 06:29 - crash (1+04:04) +kbrazil ttyS0 Fri Nov 8 06:24 - crash (1+04:09) +reboot system boot 3.10.0-1062.1.2. Fri Nov 8 06:14 - 15:27 (228+08:13) +kbrazil tty1 Sun Nov 3 12:20 - crash (4+17:54) +kbrazil ttyS0 Sun Nov 3 11:04 - 11:05 (00:01) +kbrazil pts/0 192.168.71.1 Sat Nov 2 19:26 - crash (5+11:47) +kbrazil ttyS0 Fri Nov 1 15:14 - 11:03 (1+20:49) +reboot system boot 3.10.0-1062.1.2. Fri Nov 1 15:13 - 15:27 (235+00:14) +kbrazil ttyS0 Fri Nov 1 11:16 - 11:36 (00:20) +reboot system boot 3.10.0-1062.1.2. Fri Nov 1 06:00 - 11:36 (05:36) +kbrazil ttyS0 Tue Oct 29 18:17 - crash (2+11:43) +reboot system boot 3.10.0-1062.1.2. Tue Oct 29 18:16 - 11:36 (2+17:19) +kbrazil pts/0 192.168.71.1 Sat Oct 26 09:53 - 15:13 (05:19) +kbrazil ttyS0 Fri Oct 25 18:22 - crash (3+23:54) +reboot system boot 3.10.0-1062.1.2. Fri Oct 25 18:21 - 11:36 (6+17:14) +kbrazil ttyS0 Fri Oct 25 17:14 - 18:21 (01:06) +reboot system boot 3.10.0-1062.1.2. Fri Oct 25 17:13 - 11:36 (6+18:22) +kbrazil ttyS0 Fri Oct 25 15:43 - 17:13 (01:29) +reboot system boot 3.10.0-1062.1.2. Fri Oct 25 13:29 - 17:13 (03:44) +kbrazil ttyS0 Mon Oct 21 13:19 - 19:22 (2+06:03) +reboot system boot 3.10.0-1062.1.2. Mon Oct 21 13:17 - 19:22 (2+06:05) +kbrazil ttyS0 Wed Oct 16 03:23 - crash (5+09:54) +kbrazil ttyS0 Tue Oct 15 16:49 - 03:23 (10:34) +kbrazil ttyS0 Tue Oct 15 10:39 - 16:48 (06:09) +reboot system boot 3.10.0-957.27.2. Tue Oct 15 10:39 - 19:22 (8+08:43) +kbrazil ttyS0 Thu Aug 15 16:05 - 16:05 (00:00) +reboot system boot 3.10.0-957.27.2. Thu Aug 15 16:05 - 16:05 (00:00) +reboot system boot 3.10.0-957.27.2. Thu Aug 15 16:00 - 16:05 (00:05) +kbrazil ttyS0 Thu Aug 15 14:25 - crash (01:35) +reboot system boot 3.10.0-957.27.2. Thu Aug 15 14:24 - 16:05 (01:41) +kbrazil ttyS0 Thu Aug 15 11:58 - crash (02:25) +reboot system boot 3.10.0-957.el7.x Thu Aug 15 11:58 - 16:05 (04:07) +kbrazil ttyS0 Thu Aug 15 11:57 - 11:57 (00:00) +reboot system boot 3.10.0-957.el7.x Thu Aug 15 11:57 - 16:05 (04:08) +kbrazil pts/0 192.168.71.1 Thu Aug 15 10:58 - 11:56 (00:58) +root tty1 Thu Aug 15 10:57 - 11:56 (00:59) +reboot system boot 3.10.0-957.el7.x Thu Aug 15 10:57 - 11:56 (00:59) + +wtmp begins Thu Aug 15 10:57:06 2019 diff --git a/tests/fixtures/centos-7.7/last-wF.json b/tests/fixtures/centos-7.7/last-wF.json new file mode 100644 index 00000000..35ae5132 --- /dev/null +++ b/tests/fixtures/centos-7.7/last-wF.json @@ -0,0 +1 @@ +[{"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Tue Jan 5 14:29:24 2021", "logout": "still logged in"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jan 5 14:28:41 2021", "logout": "still logged in"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Jan 5 14:28:28 2021", "logout": "Tue Jan 5 14:29:36 2021", "duration": "00:01"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Jan 4 12:29:04 2021", "logout": "crash", "duration": "1+01:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Jan 4 12:11:44 2021", "logout": "Tue Jan 5 14:29:36 2021", "duration": "1+02:17"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Wed Dec 30 11:12:50 2020", "logout": "crash", "duration": "5+00:58"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Dec 30 10:59:51 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "6+03:29"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Tue Dec 29 10:14:19 2020", "logout": "crash", "duration": "1+00:45"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Dec 29 10:11:44 2020", "logout": "crash", "duration": "1+00:48"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Dec 29 10:11:28 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "7+04:18"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Wed Aug 12 15:21:36 2020", "logout": "crash", "duration": "138+19:49"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed Aug 12 15:08:20 2020", "logout": "crash", "duration": "138+20:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Aug 12 15:07:27 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "146+00:22"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Tue Aug 4 09:39:30 2020", "logout": "crash", "duration": "8+05:27"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Aug 4 09:39:01 2020", "logout": "crash", "duration": "8+05:28"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Aug 4 09:30:24 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "154+05:59"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Sat Aug 1 08:58:14 2020", "logout": "crash", "duration": "3+00:32"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Jul 31 13:55:56 2020", "logout": "crash", "duration": "3+19:34"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Jul 31 13:55:35 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "158+01:34"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Thu Jul 30 08:34:03 2020", "logout": "crash", "duration": "1+05:21"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Thu Jul 30 08:31:17 2020", "logout": "crash", "duration": "1+05:24"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu Jul 30 08:31:03 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "159+06:58"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Tue Jul 28 19:23:39 2020", "logout": "crash", "duration": "1+13:07"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jul 28 19:23:23 2020", "logout": "crash", "duration": "1+13:07"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Jul 28 19:22:40 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "160+20:06"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Tue Jul 28 16:27:59 2020", "logout": "crash", "duration": "02:54"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jul 28 16:27:26 2020", "logout": "crash", "duration": "02:55"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Jul 28 13:22:23 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "161+02:07"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Tue Jul 28 00:13:44 2020", "logout": "crash", "duration": "13:08"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Mon Jul 27 20:23:44 2020", "logout": "Tue Jul 28 00:13:35 2020", "duration": "03:49"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Jul 27 20:23:17 2020", "logout": "crash", "duration": "16:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Jul 27 20:04:44 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "161+19:24"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Tue Jul 21 09:15:29 2020", "logout": "crash", "duration": "6+10:49"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jul 21 09:15:07 2020", "logout": "crash", "duration": "6+10:49"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Jul 21 09:14:38 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "168+06:14"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "kbrazil-mac.attlocal.net", "login": "Fri Jul 17 19:12:43 2020", "logout": "Fri Jul 17 19:13:04 2020", "duration": "00:00"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri Jul 17 15:49:03 2020", "logout": "crash", "duration": "3+17:25"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Jul 17 15:48:35 2020", "logout": "crash", "duration": "3+17:26"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Jul 17 15:48:11 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "171+23:41"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "kbrazil-mac.attlocal.net", "login": "Fri Jul 17 01:52:05 2020", "logout": "crash", "duration": "13:56"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Thu Jul 16 14:48:42 2020", "logout": "crash", "duration": "1+00:59"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Thu Jul 16 14:10:31 2020", "logout": "Thu Jul 16 16:26:07 2020", "duration": "02:15"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Thu Jul 16 14:09:55 2020", "logout": "crash", "duration": "1+01:38"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu Jul 16 08:35:02 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "173+06:54"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Jul 8 13:44:04 2020", "logout": "crash", "duration": "7+18:50"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed Jul 8 13:12:29 2020", "logout": "crash", "duration": "7+19:22"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Jul 8 11:27:06 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "181+04:02"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Jun 26 11:53:28 2020", "logout": "crash", "duration": "11+23:33"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Jun 26 11:52:15 2020", "logout": "Tue Jan 5 14:29:36 2021", "duration": "193+03:37"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Jun 23 15:23:50 2020", "logout": "Tue Jun 23 15:27:26 2020", "duration": "00:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Jun 23 15:23:25 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "00:04"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri Jun 19 10:47:07 2020", "logout": "crash", "duration": "4+04:36"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Jun 19 10:46:46 2020", "logout": "crash", "duration": "4+04:36"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Jun 19 10:29:25 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "4+04:58"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Mon Jun 8 10:30:52 2020", "logout": "crash", "duration": "10+23:58"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Jun 8 10:30:29 2020", "logout": "crash", "duration": "10+23:58"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Jun 8 10:30:06 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "15+04:57"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Jun 2 12:05:38 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "21+03:21"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Tue Jun 2 08:38:47 2020", "logout": "crash", "duration": "03:26"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Jun 2 08:38:36 2020", "logout": "crash", "duration": "03:27"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Jun 2 06:13:40 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "21+09:13"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sun May 24 16:10:42 2020", "logout": "Sun May 24 17:18:58 2020", "duration": "01:08"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Sun May 24 15:34:27 2020", "logout": "crash", "duration": "8+14:39"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Sun May 24 15:34:01 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "29+23:53"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Fri May 22 13:39:48 2020", "logout": "crash", "duration": "2+01:54"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri May 22 13:11:05 2020", "logout": "crash", "duration": "2+02:22"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri May 22 13:10:36 2020", "logout": "crash", "duration": "2+02:23"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri May 22 12:49:57 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "32+02:37"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri May 22 08:44:51 2020", "logout": "crash", "duration": "04:05"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri May 22 08:44:09 2020", "logout": "crash", "duration": "04:05"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri May 22 08:43:50 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "32+06:43"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Thu May 14 16:39:13 2020", "logout": "crash", "duration": "7+16:04"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu May 14 16:39:00 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "39+22:48"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Wed May 13 10:23:33 2020", "logout": "crash", "duration": "1+06:15"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed May 13 10:22:38 2020", "logout": "crash", "duration": "1+06:16"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed May 13 09:51:51 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "41+05:35"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Wed Apr 15 13:00:16 2020", "logout": "crash", "duration": "27+20:51"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Wed Apr 15 12:38:34 2020", "logout": "Wed Apr 15 13:01:29 2020", "duration": "00:22"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Wed Apr 15 12:28:46 2020", "logout": "Wed Apr 15 20:44:22 2020", "duration": "08:15"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Apr 15 04:02:22 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "69+11:25"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Apr 14 16:02:37 2020", "logout": "crash", "duration": "11:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Apr 14 16:02:17 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "69+23:25"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Apr 14 08:44:45 2020", "logout": "Tue Apr 14 10:00:46 2020", "duration": "01:16"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Apr 14 06:57:27 2020", "logout": "Tue Apr 14 08:44:39 2020", "duration": "01:47"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Apr 14 06:56:01 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "70+08:31"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Tue Apr 7 17:33:04 2020", "logout": "crash", "duration": "6+13:22"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Apr 6 21:22:49 2020", "logout": "Mon Apr 6 22:42:06 2020", "duration": "01:19"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Mon Apr 6 19:43:25 2020", "logout": "Mon Apr 6 19:45:24 2020", "duration": "00:01"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Apr 4 17:31:48 2020", "logout": "crash", "duration": "9+13:24"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Sat Apr 4 17:17:00 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "79+22:10"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sun Mar 29 12:42:56 2020", "logout": "crash", "duration": "6+04:34"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 24 11:21:56 2020", "logout": "Sun Mar 29 12:42:50 2020", "duration": "5+01:20"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 24 11:18:00 2020", "logout": "Tue Mar 24 11:21:51 2020", "duration": "00:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Mar 24 10:57:02 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "91+04:30"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 17 06:56:55 2020", "logout": "crash", "duration": "7+04:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Mar 17 05:12:10 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "98+10:15"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Mar 12 10:12:42 2020", "logout": "crash", "duration": "4+18:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu Mar 12 09:22:03 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "103+06:05"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Mar 11 13:29:24 2020", "logout": "crash", "duration": "19:52"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Mar 11 12:19:59 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "104+03:07"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 10 17:53:11 2020", "logout": "crash", "duration": "18:26"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Mar 10 17:52:57 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "104+21:34"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Mar 10 13:09:01 2020", "logout": "crash", "duration": "04:43"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Mar 10 13:08:45 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "105+02:18"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Mar 7 18:13:19 2020", "logout": "crash", "duration": "2+17:55"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Sat Mar 7 18:13:04 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "107+20:14"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Mar 5 14:48:23 2020", "logout": "crash", "duration": "2+03:24"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu Mar 5 03:02:06 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "110+11:25"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Mar 2 19:53:22 2020", "logout": "crash", "duration": "2+07:08"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Mar 2 19:53:07 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "112+18:34"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Feb 29 18:43:55 2020", "logout": "crash", "duration": "2+01:09"}, {"user": "kbrazil", "tty": "pts/1", "hostname": "192.168.71.1", "login": "Sat Feb 29 18:08:17 2020", "logout": "Sat Feb 29 18:28:47 2020", "duration": "00:20"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Feb 29 15:16:16 2020", "logout": "Sat Feb 29 18:42:49 2020", "duration": "03:26"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Feb 29 12:14:10 2020", "logout": "crash", "duration": "2+07:38"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Sat Feb 29 12:13:44 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "115+02:13"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Feb 28 13:49:56 2020", "logout": "crash", "duration": "22:23"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Feb 28 12:56:05 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "116+01:31"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 27 16:01:25 2020", "logout": "crash", "duration": "20:54"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu Feb 27 15:51:42 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "116+22:35"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 27 10:50:36 2020", "logout": "crash", "duration": "05:01"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Feb 26 20:05:10 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "117+18:22"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 20 14:42:01 2020", "logout": "crash", "duration": "6+05:23"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu Feb 20 14:41:39 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "123+23:45"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Feb 17 17:48:58 2020", "logout": "crash", "duration": "2+20:52"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Feb 17 17:48:37 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "126+20:38"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Feb 13 16:44:51 2020", "logout": "crash", "duration": "4+01:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Thu Feb 13 16:44:31 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "130+21:42"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Feb 5 14:23:46 2020", "logout": "crash", "duration": "8+02:20"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Feb 5 11:43:15 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "139+02:44"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Feb 4 14:28:14 2020", "logout": "crash", "duration": "21:15"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Feb 4 01:28:02 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "140+12:59"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Jan 13 17:28:13 2020", "logout": "crash", "duration": "21+07:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Jan 13 16:16:04 2020", "logout": "Tue Jun 23 15:27:28 2020", "duration": "161+22:11"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Dec 16 11:15:00 2019", "logout": "crash", "duration": "28+05:01"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Dec 16 11:14:30 2019", "logout": "Tue Jun 23 15:27:28 2020", "duration": "190+03:12"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Dec 4 21:41:25 2019", "logout": "crash", "duration": "11+13:33"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Wed Dec 4 21:40:48 2019", "logout": "Tue Jun 23 15:27:28 2020", "duration": "201+16:46"}, {"user": "kbrazil", "tty": "pts/1", "hostname": null, "login": "Sat Nov 16 14:40:36 2019", "logout": "Sat Nov 16 14:40:41 2019", "duration": "00:00"}, {"user": "kbrazil", "tty": "pts/1", "hostname": null, "login": "Sat Nov 16 14:39:29 2019", "logout": "Sat Nov 16 14:39:42 2019", "duration": "00:00"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "localhost", "login": "Tue Nov 12 07:19:39 2019", "logout": "crash", "duration": "22+14:21"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Nov 12 07:18:40 2019", "logout": "crash", "duration": "22+14:22"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "localhost", "login": "Sun Nov 10 08:21:36 2019", "logout": "Mon Nov 11 15:22:36 2019", "duration": "1+07:01"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sat Nov 9 10:34:48 2019", "logout": "Tue Nov 12 07:16:59 2019", "duration": "2+20:42"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Sat Nov 9 10:34:26 2019", "logout": "Tue Jun 23 15:27:28 2020", "duration": "227+03:53"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Fri Nov 8 07:49:24 2019", "logout": "crash", "duration": "1+02:45"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Fri Nov 8 06:29:41 2019", "logout": "crash", "duration": "1+04:04"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Nov 8 06:24:27 2019", "logout": "crash", "duration": "1+04:09"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Nov 8 06:14:17 2019", "logout": "Tue Jun 23 15:27:28 2020", "duration": "228+08:13"}, {"user": "kbrazil", "tty": "tty1", "hostname": null, "login": "Sun Nov 3 12:20:05 2019", "logout": "crash", "duration": "4+17:54"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Sun Nov 3 11:04:48 2019", "logout": "Sun Nov 3 11:05:50 2019", "duration": "00:01"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Nov 2 19:26:52 2019", "logout": "crash", "duration": "5+11:47"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Nov 1 15:14:12 2019", "logout": "Sun Nov 3 11:03:55 2019", "duration": "1+20:49"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Nov 1 15:13:19 2019", "logout": "Tue Jun 23 15:27:28 2020", "duration": "235+00:14"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Nov 1 11:16:36 2019", "logout": "Fri Nov 1 11:36:43 2019", "duration": "00:20"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Nov 1 06:00:15 2019", "logout": "Fri Nov 1 11:36:44 2019", "duration": "05:36"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Oct 29 18:17:00 2019", "logout": "crash", "duration": "2+11:43"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Tue Oct 29 18:16:45 2019", "logout": "Fri Nov 1 11:36:44 2019", "duration": "2+17:19"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Sat Oct 26 09:53:36 2019", "logout": "Sat Oct 26 15:13:20 2019", "duration": "05:19"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Oct 25 18:22:10 2019", "logout": "crash", "duration": "3+23:54"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Oct 25 18:21:45 2019", "logout": "Fri Nov 1 11:36:44 2019", "duration": "6+17:14"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Oct 25 17:14:54 2019", "logout": "Fri Oct 25 18:21:32 2019", "duration": "01:06"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Oct 25 17:13:49 2019", "logout": "Fri Nov 1 11:36:44 2019", "duration": "6+18:22"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Fri Oct 25 15:43:55 2019", "logout": "Fri Oct 25 17:13:43 2019", "duration": "01:29"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Fri Oct 25 13:29:01 2019", "logout": "Fri Oct 25 17:13:45 2019", "duration": "03:44"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Mon Oct 21 13:19:30 2019", "logout": "Wed Oct 23 19:22:56 2019", "duration": "2+06:03"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-1062.1.2.el7.x86_64", "login": "Mon Oct 21 13:17:47 2019", "logout": "Wed Oct 23 19:22:58 2019", "duration": "2+06:05"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Wed Oct 16 03:23:21 2019", "logout": "crash", "duration": "5+09:54"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Oct 15 16:49:02 2019", "logout": "Wed Oct 16 03:23:15 2019", "duration": "10:34"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Tue Oct 15 10:39:44 2019", "logout": "Tue Oct 15 16:48:54 2019", "duration": "06:09"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.el7.x86_64", "login": "Tue Oct 15 10:39:10 2019", "logout": "Wed Oct 23 19:22:58 2019", "duration": "8+08:43"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 16:05:30 2019", "logout": "Thu Aug 15 16:05:50 2019", "duration": "00:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.el7.x86_64", "login": "Thu Aug 15 16:05:10 2019", "logout": "Thu Aug 15 16:05:52 2019", "duration": "00:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.el7.x86_64", "login": "Thu Aug 15 16:00:45 2019", "logout": "Thu Aug 15 16:05:52 2019", "duration": "00:05"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 14:25:00 2019", "logout": "crash", "duration": "01:35"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.27.2.el7.x86_64", "login": "Thu Aug 15 14:24:43 2019", "logout": "Thu Aug 15 16:05:52 2019", "duration": "01:41"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 11:58:46 2019", "logout": "crash", "duration": "02:25"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.el7.x86_64", "login": "Thu Aug 15 11:58:06 2019", "logout": "Thu Aug 15 16:05:52 2019", "duration": "04:07"}, {"user": "kbrazil", "tty": "ttyS0", "hostname": null, "login": "Thu Aug 15 11:57:28 2019", "logout": "Thu Aug 15 11:57:40 2019", "duration": "00:00"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.el7.x86_64", "login": "Thu Aug 15 11:57:07 2019", "logout": "Thu Aug 15 16:05:52 2019", "duration": "04:08"}, {"user": "kbrazil", "tty": "pts/0", "hostname": "192.168.71.1", "login": "Thu Aug 15 10:58:29 2019", "logout": "Thu Aug 15 11:56:42 2019", "duration": "00:58"}, {"user": "root", "tty": "tty1", "hostname": null, "login": "Thu Aug 15 10:57:26 2019", "logout": "Thu Aug 15 11:56:42 2019", "duration": "00:59"}, {"user": "reboot", "tty": "system boot", "hostname": "3.10.0-957.el7.x86_64", "login": "Thu Aug 15 10:57:06 2019", "logout": "Thu Aug 15 11:56:44 2019", "duration": "00:59"}] diff --git a/tests/fixtures/centos-7.7/last-wF.out b/tests/fixtures/centos-7.7/last-wF.out new file mode 100644 index 00000000..ac28f78c --- /dev/null +++ b/tests/fixtures/centos-7.7/last-wF.out @@ -0,0 +1,184 @@ +kbrazil pts/0 kbrazil-mac.attlocal.net Tue Jan 5 14:29:24 2021 still logged in +kbrazil tty1 Tue Jan 5 14:28:41 2021 still logged in +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Jan 5 14:28:28 2021 - Tue Jan 5 14:29:36 2021 (00:01) +kbrazil tty1 Mon Jan 4 12:29:04 2021 - crash (1+01:59) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Jan 4 12:11:44 2021 - Tue Jan 5 14:29:36 2021 (1+02:17) +kbrazil pts/0 kbrazil-mac.attlocal.net Wed Dec 30 11:12:50 2020 - crash (5+00:58) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Dec 30 10:59:51 2020 - Tue Jan 5 14:29:36 2021 (6+03:29) +kbrazil pts/0 kbrazil-mac.attlocal.net Tue Dec 29 10:14:19 2020 - crash (1+00:45) +kbrazil tty1 Tue Dec 29 10:11:44 2020 - crash (1+00:48) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Dec 29 10:11:28 2020 - Tue Jan 5 14:29:36 2021 (7+04:18) +kbrazil pts/0 kbrazil-mac.attlocal.net Wed Aug 12 15:21:36 2020 - crash (138+19:49) +kbrazil tty1 Wed Aug 12 15:08:20 2020 - crash (138+20:03) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Aug 12 15:07:27 2020 - Tue Jan 5 14:29:36 2021 (146+00:22) +kbrazil pts/0 kbrazil-mac.attlocal.net Tue Aug 4 09:39:30 2020 - crash (8+05:27) +kbrazil tty1 Tue Aug 4 09:39:01 2020 - crash (8+05:28) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Aug 4 09:30:24 2020 - Tue Jan 5 14:29:36 2021 (154+05:59) +kbrazil pts/0 kbrazil-mac.attlocal.net Sat Aug 1 08:58:14 2020 - crash (3+00:32) +kbrazil tty1 Fri Jul 31 13:55:56 2020 - crash (3+19:34) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Jul 31 13:55:35 2020 - Tue Jan 5 14:29:36 2021 (158+01:34) +kbrazil pts/0 kbrazil-mac.attlocal.net Thu Jul 30 08:34:03 2020 - crash (1+05:21) +kbrazil tty1 Thu Jul 30 08:31:17 2020 - crash (1+05:24) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu Jul 30 08:31:03 2020 - Tue Jan 5 14:29:36 2021 (159+06:58) +kbrazil pts/0 kbrazil-mac.attlocal.net Tue Jul 28 19:23:39 2020 - crash (1+13:07) +kbrazil tty1 Tue Jul 28 19:23:23 2020 - crash (1+13:07) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Jul 28 19:22:40 2020 - Tue Jan 5 14:29:36 2021 (160+20:06) +kbrazil pts/0 kbrazil-mac.attlocal.net Tue Jul 28 16:27:59 2020 - crash (02:54) +kbrazil tty1 Tue Jul 28 16:27:26 2020 - crash (02:55) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Jul 28 13:22:23 2020 - Tue Jan 5 14:29:36 2021 (161+02:07) +kbrazil pts/0 kbrazil-mac.attlocal.net Tue Jul 28 00:13:44 2020 - crash (13:08) +kbrazil pts/0 kbrazil-mac.attlocal.net Mon Jul 27 20:23:44 2020 - Tue Jul 28 00:13:35 2020 (03:49) +kbrazil tty1 Mon Jul 27 20:23:17 2020 - crash (16:59) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Jul 27 20:04:44 2020 - Tue Jan 5 14:29:36 2021 (161+19:24) +kbrazil pts/0 kbrazil-mac.attlocal.net Tue Jul 21 09:15:29 2020 - crash (6+10:49) +kbrazil tty1 Tue Jul 21 09:15:07 2020 - crash (6+10:49) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Jul 21 09:14:38 2020 - Tue Jan 5 14:29:36 2021 (168+06:14) +kbrazil pts/1 kbrazil-mac.attlocal.net Fri Jul 17 19:12:43 2020 - Fri Jul 17 19:13:04 2020 (00:00) +kbrazil pts/0 192.168.71.1 Fri Jul 17 15:49:03 2020 - crash (3+17:25) +kbrazil tty1 Fri Jul 17 15:48:35 2020 - crash (3+17:26) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Jul 17 15:48:11 2020 - Tue Jan 5 14:29:36 2021 (171+23:41) +kbrazil pts/0 kbrazil-mac.attlocal.net Fri Jul 17 01:52:05 2020 - crash (13:56) +kbrazil pts/1 192.168.71.1 Thu Jul 16 14:48:42 2020 - crash (1+00:59) +kbrazil pts/0 192.168.71.1 Thu Jul 16 14:10:31 2020 - Thu Jul 16 16:26:07 2020 (02:15) +kbrazil tty1 Thu Jul 16 14:09:55 2020 - crash (1+01:38) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu Jul 16 08:35:02 2020 - Tue Jan 5 14:29:36 2021 (173+06:54) +kbrazil ttyS0 Wed Jul 8 13:44:04 2020 - crash (7+18:50) +kbrazil tty1 Wed Jul 8 13:12:29 2020 - crash (7+19:22) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Jul 8 11:27:06 2020 - Tue Jan 5 14:29:36 2021 (181+04:02) +kbrazil ttyS0 Fri Jun 26 11:53:28 2020 - crash (11+23:33) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Jun 26 11:52:15 2020 - Tue Jan 5 14:29:36 2021 (193+03:37) +kbrazil ttyS0 Tue Jun 23 15:23:50 2020 - Tue Jun 23 15:27:26 2020 (00:03) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Jun 23 15:23:25 2020 - Tue Jun 23 15:27:28 2020 (00:04) +kbrazil pts/0 192.168.71.1 Fri Jun 19 10:47:07 2020 - crash (4+04:36) +kbrazil tty1 Fri Jun 19 10:46:46 2020 - crash (4+04:36) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Jun 19 10:29:25 2020 - Tue Jun 23 15:27:28 2020 (4+04:58) +kbrazil pts/0 192.168.71.1 Mon Jun 8 10:30:52 2020 - crash (10+23:58) +kbrazil tty1 Mon Jun 8 10:30:29 2020 - crash (10+23:58) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Jun 8 10:30:06 2020 - Tue Jun 23 15:27:28 2020 (15+04:57) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Jun 2 12:05:38 2020 - Tue Jun 23 15:27:28 2020 (21+03:21) +kbrazil pts/0 192.168.71.1 Tue Jun 2 08:38:47 2020 - crash (03:26) +kbrazil tty1 Tue Jun 2 08:38:36 2020 - crash (03:27) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Jun 2 06:13:40 2020 - Tue Jun 23 15:27:28 2020 (21+09:13) +kbrazil pts/0 192.168.71.1 Sun May 24 16:10:42 2020 - Sun May 24 17:18:58 2020 (01:08) +kbrazil tty1 Sun May 24 15:34:27 2020 - crash (8+14:39) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Sun May 24 15:34:01 2020 - Tue Jun 23 15:27:28 2020 (29+23:53) +kbrazil pts/1 192.168.71.1 Fri May 22 13:39:48 2020 - crash (2+01:54) +kbrazil pts/0 192.168.71.1 Fri May 22 13:11:05 2020 - crash (2+02:22) +kbrazil tty1 Fri May 22 13:10:36 2020 - crash (2+02:23) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri May 22 12:49:57 2020 - Tue Jun 23 15:27:28 2020 (32+02:37) +kbrazil pts/0 192.168.71.1 Fri May 22 08:44:51 2020 - crash (04:05) +kbrazil tty1 Fri May 22 08:44:09 2020 - crash (04:05) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri May 22 08:43:50 2020 - Tue Jun 23 15:27:28 2020 (32+06:43) +kbrazil tty1 Thu May 14 16:39:13 2020 - crash (7+16:04) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu May 14 16:39:00 2020 - Tue Jun 23 15:27:28 2020 (39+22:48) +kbrazil pts/0 192.168.71.1 Wed May 13 10:23:33 2020 - crash (1+06:15) +kbrazil tty1 Wed May 13 10:22:38 2020 - crash (1+06:16) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed May 13 09:51:51 2020 - Tue Jun 23 15:27:28 2020 (41+05:35) +kbrazil pts/1 192.168.71.1 Wed Apr 15 13:00:16 2020 - crash (27+20:51) +kbrazil pts/0 192.168.71.1 Wed Apr 15 12:38:34 2020 - Wed Apr 15 13:01:29 2020 (00:22) +kbrazil tty1 Wed Apr 15 12:28:46 2020 - Wed Apr 15 20:44:22 2020 (08:15) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Apr 15 04:02:22 2020 - Tue Jun 23 15:27:28 2020 (69+11:25) +kbrazil ttyS0 Tue Apr 14 16:02:37 2020 - crash (11:59) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Apr 14 16:02:17 2020 - Tue Jun 23 15:27:28 2020 (69+23:25) +kbrazil ttyS0 Tue Apr 14 08:44:45 2020 - Tue Apr 14 10:00:46 2020 (01:16) +kbrazil ttyS0 Tue Apr 14 06:57:27 2020 - Tue Apr 14 08:44:39 2020 (01:47) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Apr 14 06:56:01 2020 - Tue Jun 23 15:27:28 2020 (70+08:31) +kbrazil tty1 Tue Apr 7 17:33:04 2020 - crash (6+13:22) +kbrazil tty1 Mon Apr 6 21:22:49 2020 - Mon Apr 6 22:42:06 2020 (01:19) +kbrazil tty1 Mon Apr 6 19:43:25 2020 - Mon Apr 6 19:45:24 2020 (00:01) +kbrazil ttyS0 Sat Apr 4 17:31:48 2020 - crash (9+13:24) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Sat Apr 4 17:17:00 2020 - Tue Jun 23 15:27:28 2020 (79+22:10) +kbrazil ttyS0 Sun Mar 29 12:42:56 2020 - crash (6+04:34) +kbrazil ttyS0 Tue Mar 24 11:21:56 2020 - Sun Mar 29 12:42:50 2020 (5+01:20) +kbrazil ttyS0 Tue Mar 24 11:18:00 2020 - Tue Mar 24 11:21:51 2020 (00:03) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Mar 24 10:57:02 2020 - Tue Jun 23 15:27:28 2020 (91+04:30) +kbrazil ttyS0 Tue Mar 17 06:56:55 2020 - crash (7+04:00) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Mar 17 05:12:10 2020 - Tue Jun 23 15:27:28 2020 (98+10:15) +kbrazil ttyS0 Thu Mar 12 10:12:42 2020 - crash (4+18:59) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu Mar 12 09:22:03 2020 - Tue Jun 23 15:27:28 2020 (103+06:05) +kbrazil ttyS0 Wed Mar 11 13:29:24 2020 - crash (19:52) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Mar 11 12:19:59 2020 - Tue Jun 23 15:27:28 2020 (104+03:07) +kbrazil ttyS0 Tue Mar 10 17:53:11 2020 - crash (18:26) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Mar 10 17:52:57 2020 - Tue Jun 23 15:27:28 2020 (104+21:34) +kbrazil ttyS0 Tue Mar 10 13:09:01 2020 - crash (04:43) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Mar 10 13:08:45 2020 - Tue Jun 23 15:27:28 2020 (105+02:18) +kbrazil ttyS0 Sat Mar 7 18:13:19 2020 - crash (2+17:55) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Sat Mar 7 18:13:04 2020 - Tue Jun 23 15:27:28 2020 (107+20:14) +kbrazil ttyS0 Thu Mar 5 14:48:23 2020 - crash (2+03:24) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu Mar 5 03:02:06 2020 - Tue Jun 23 15:27:28 2020 (110+11:25) +kbrazil ttyS0 Mon Mar 2 19:53:22 2020 - crash (2+07:08) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Mar 2 19:53:07 2020 - Tue Jun 23 15:27:28 2020 (112+18:34) +kbrazil pts/0 192.168.71.1 Sat Feb 29 18:43:55 2020 - crash (2+01:09) +kbrazil pts/1 192.168.71.1 Sat Feb 29 18:08:17 2020 - Sat Feb 29 18:28:47 2020 (00:20) +kbrazil pts/0 192.168.71.1 Sat Feb 29 15:16:16 2020 - Sat Feb 29 18:42:49 2020 (03:26) +kbrazil ttyS0 Sat Feb 29 12:14:10 2020 - crash (2+07:38) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Sat Feb 29 12:13:44 2020 - Tue Jun 23 15:27:28 2020 (115+02:13) +kbrazil ttyS0 Fri Feb 28 13:49:56 2020 - crash (22:23) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Feb 28 12:56:05 2020 - Tue Jun 23 15:27:28 2020 (116+01:31) +kbrazil ttyS0 Thu Feb 27 16:01:25 2020 - crash (20:54) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu Feb 27 15:51:42 2020 - Tue Jun 23 15:27:28 2020 (116+22:35) +kbrazil ttyS0 Thu Feb 27 10:50:36 2020 - crash (05:01) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Feb 26 20:05:10 2020 - Tue Jun 23 15:27:28 2020 (117+18:22) +kbrazil ttyS0 Thu Feb 20 14:42:01 2020 - crash (6+05:23) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu Feb 20 14:41:39 2020 - Tue Jun 23 15:27:28 2020 (123+23:45) +kbrazil ttyS0 Mon Feb 17 17:48:58 2020 - crash (2+20:52) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Feb 17 17:48:37 2020 - Tue Jun 23 15:27:28 2020 (126+20:38) +kbrazil ttyS0 Thu Feb 13 16:44:51 2020 - crash (4+01:03) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Thu Feb 13 16:44:31 2020 - Tue Jun 23 15:27:28 2020 (130+21:42) +kbrazil ttyS0 Wed Feb 5 14:23:46 2020 - crash (8+02:20) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Feb 5 11:43:15 2020 - Tue Jun 23 15:27:28 2020 (139+02:44) +kbrazil ttyS0 Tue Feb 4 14:28:14 2020 - crash (21:15) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Feb 4 01:28:02 2020 - Tue Jun 23 15:27:28 2020 (140+12:59) +kbrazil ttyS0 Mon Jan 13 17:28:13 2020 - crash (21+07:59) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Jan 13 16:16:04 2020 - Tue Jun 23 15:27:28 2020 (161+22:11) +kbrazil ttyS0 Mon Dec 16 11:15:00 2019 - crash (28+05:01) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Dec 16 11:14:30 2019 - Tue Jun 23 15:27:28 2020 (190+03:12) +kbrazil ttyS0 Wed Dec 4 21:41:25 2019 - crash (11+13:33) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Wed Dec 4 21:40:48 2019 - Tue Jun 23 15:27:28 2020 (201+16:46) +kbrazil pts/1 Sat Nov 16 14:40:36 2019 - Sat Nov 16 14:40:41 2019 (00:00) +kbrazil pts/1 Sat Nov 16 14:39:29 2019 - Sat Nov 16 14:39:42 2019 (00:00) +kbrazil pts/0 localhost Tue Nov 12 07:19:39 2019 - crash (22+14:21) +kbrazil ttyS0 Tue Nov 12 07:18:40 2019 - crash (22+14:22) +kbrazil pts/0 localhost Sun Nov 10 08:21:36 2019 - Mon Nov 11 15:22:36 2019 (1+07:01) +kbrazil ttyS0 Sat Nov 9 10:34:48 2019 - Tue Nov 12 07:16:59 2019 (2+20:42) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Sat Nov 9 10:34:26 2019 - Tue Jun 23 15:27:28 2020 (227+03:53) +kbrazil tty1 Fri Nov 8 07:49:24 2019 - crash (1+02:45) +kbrazil pts/0 192.168.71.1 Fri Nov 8 06:29:41 2019 - crash (1+04:04) +kbrazil ttyS0 Fri Nov 8 06:24:27 2019 - crash (1+04:09) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Nov 8 06:14:17 2019 - Tue Jun 23 15:27:28 2020 (228+08:13) +kbrazil tty1 Sun Nov 3 12:20:05 2019 - crash (4+17:54) +kbrazil ttyS0 Sun Nov 3 11:04:48 2019 - Sun Nov 3 11:05:50 2019 (00:01) +kbrazil pts/0 192.168.71.1 Sat Nov 2 19:26:52 2019 - crash (5+11:47) +kbrazil ttyS0 Fri Nov 1 15:14:12 2019 - Sun Nov 3 11:03:55 2019 (1+20:49) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Nov 1 15:13:19 2019 - Tue Jun 23 15:27:28 2020 (235+00:14) +kbrazil ttyS0 Fri Nov 1 11:16:36 2019 - Fri Nov 1 11:36:43 2019 (00:20) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Nov 1 06:00:15 2019 - Fri Nov 1 11:36:44 2019 (05:36) +kbrazil ttyS0 Tue Oct 29 18:17:00 2019 - crash (2+11:43) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Tue Oct 29 18:16:45 2019 - Fri Nov 1 11:36:44 2019 (2+17:19) +kbrazil pts/0 192.168.71.1 Sat Oct 26 09:53:36 2019 - Sat Oct 26 15:13:20 2019 (05:19) +kbrazil ttyS0 Fri Oct 25 18:22:10 2019 - crash (3+23:54) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Oct 25 18:21:45 2019 - Fri Nov 1 11:36:44 2019 (6+17:14) +kbrazil ttyS0 Fri Oct 25 17:14:54 2019 - Fri Oct 25 18:21:32 2019 (01:06) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Oct 25 17:13:49 2019 - Fri Nov 1 11:36:44 2019 (6+18:22) +kbrazil ttyS0 Fri Oct 25 15:43:55 2019 - Fri Oct 25 17:13:43 2019 (01:29) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Fri Oct 25 13:29:01 2019 - Fri Oct 25 17:13:45 2019 (03:44) +kbrazil ttyS0 Mon Oct 21 13:19:30 2019 - Wed Oct 23 19:22:56 2019 (2+06:03) +reboot system boot 3.10.0-1062.1.2.el7.x86_64 Mon Oct 21 13:17:47 2019 - Wed Oct 23 19:22:58 2019 (2+06:05) +kbrazil ttyS0 Wed Oct 16 03:23:21 2019 - crash (5+09:54) +kbrazil ttyS0 Tue Oct 15 16:49:02 2019 - Wed Oct 16 03:23:15 2019 (10:34) +kbrazil ttyS0 Tue Oct 15 10:39:44 2019 - Tue Oct 15 16:48:54 2019 (06:09) +reboot system boot 3.10.0-957.27.2.el7.x86_64 Tue Oct 15 10:39:10 2019 - Wed Oct 23 19:22:58 2019 (8+08:43) +kbrazil ttyS0 Thu Aug 15 16:05:30 2019 - Thu Aug 15 16:05:50 2019 (00:00) +reboot system boot 3.10.0-957.27.2.el7.x86_64 Thu Aug 15 16:05:10 2019 - Thu Aug 15 16:05:52 2019 (00:00) +reboot system boot 3.10.0-957.27.2.el7.x86_64 Thu Aug 15 16:00:45 2019 - Thu Aug 15 16:05:52 2019 (00:05) +kbrazil ttyS0 Thu Aug 15 14:25:00 2019 - crash (01:35) +reboot system boot 3.10.0-957.27.2.el7.x86_64 Thu Aug 15 14:24:43 2019 - Thu Aug 15 16:05:52 2019 (01:41) +kbrazil ttyS0 Thu Aug 15 11:58:46 2019 - crash (02:25) +reboot system boot 3.10.0-957.el7.x86_64 Thu Aug 15 11:58:06 2019 - Thu Aug 15 16:05:52 2019 (04:07) +kbrazil ttyS0 Thu Aug 15 11:57:28 2019 - Thu Aug 15 11:57:40 2019 (00:00) +reboot system boot 3.10.0-957.el7.x86_64 Thu Aug 15 11:57:07 2019 - Thu Aug 15 16:05:52 2019 (04:08) +kbrazil pts/0 192.168.71.1 Thu Aug 15 10:58:29 2019 - Thu Aug 15 11:56:42 2019 (00:58) +root tty1 Thu Aug 15 10:57:26 2019 - Thu Aug 15 11:56:42 2019 (00:59) +reboot system boot 3.10.0-957.el7.x86_64 Thu Aug 15 10:57:06 2019 - Thu Aug 15 11:56:44 2019 (00:59) + +wtmp begins Thu Aug 15 10:57:06 2019 diff --git a/tests/test_last.py b/tests/test_last.py index 4aca472d..63df44bb 100644 --- a/tests/test_last.py +++ b/tests/test_last.py @@ -40,6 +40,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-20.04/last-F.out'), 'r', encoding='utf-8') as f: self.ubuntu_20_4_last_F = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/last-crash.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_last_crash = f.read() + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/last-wF.out'), 'r', encoding='utf-8') as f: + self.centos_7_7_last_wF = f.read() + # output with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/last.json'), 'r', encoding='utf-8') as f: self.centos_7_7_last_json = json.loads(f.read()) @@ -71,6 +77,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-20.04/last-F.json'), 'r', encoding='utf-8') as f: self.ubuntu_20_4_last_F_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/last-crash.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_last_crash_json = json.loads(f.read()) + + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/last-wF.json'), 'r', encoding='utf-8') as f: + self.centos_7_7_last_wF_json = json.loads(f.read()) + def test_last_nodata(self): """ Test plain 'last' with no data @@ -137,6 +149,17 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.last.parse(self.freebsd12_last, quiet=True), self.freebsd12_last_json) + def test_last_crash_centos_7_7(self): + """ + Test plain 'last' on Centos 7.7 with crash entries + """ + self.assertEqual(jc.parsers.last.parse(self.centos_7_7_last_crash, quiet=True), self.centos_7_7_last_crash_json) + + def test_last_wF_centos_7_7(self): + """ + Test 'last -wF' on Centos 7.7 + """ + self.assertEqual(jc.parsers.last.parse(self.centos_7_7_last_wF, quiet=True), self.centos_7_7_last_wF_json) if __name__ == '__main__': unittest.main()