Whiped up a little python script:
PHP Code:
#Copy/Paste your staff= into this string here:
server_staff = "MonkeyBob,BlueMelon,Crow,Stefan"
months = ['Jan','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
f = open("rclog.txt",'r')
log = f.readlines()
f.close()
staff = server_staff.split(",")
times = {}
for s in staff:
times[s] = 'Jan 01'
for i in range(0,len(log)):
if (i+1) >= len(log):
break
line = log[i]
line2 = log[i+1]
if "is logged in from" in line2 and "Client-RC" not in line2:
acc = line2.split(" ")[0]
if acc in staff:
currentmonth = times[acc].split(" ")[0]
currentmonth_num = months.index(currentmonth)
newmonth = line.split(" ")[2]
newmonth_num = months.index(newmonth)
if newmonth_num >= currentmonth_num:
times[acc] = line[10:len(line2)-1]
for acc in times.keys():
print "Last Login ("+acc+"): "+str(times[acc])
http://pastebin.com/5yVy0e7w
Output:
PHP Code:
Last Login (BlueMelon): Sep 13 23:11:23 2012
Last Login (MonkeyBob): Sep 13 15:31:56 2012
Last Login (Stefan): Jul 18 03:36:44 2012
Last Login (Crow): Sep 13 17:12:31 2012