@@ -0,0 +1,1192 @@
+#!/usr/bin/env python%0A%0Afrom datetime import datetime%0Afrom pymongo import MongoClient%0Aimport re%0Afrom subprocess import call%0Aimport sys%0A%0A# minutes%0Awindow = 30%0A%0Aif len(sys.argv) != 2:%0A    print 'Usage: %25s %3Clogfile%3E' %25 sys.argv%5B0%5D%0A    sys.exit(1)%0A%0Anow = datetime.now()%0A%0Alogformat = re.compile('(%5Cd%7B4%7D-%5Cd%5Cd-%5Cd%5Cd %5Cd%5Cd:%5Cd%5Cd:%5Cd%5Cd).*Created new projection.*?ColumnDescriptor%5C(/(%5Cd%7B10%7D)/.*')%0A%0Aactive = set()%0A%0Awith open(sys.argv%5B1%5D) as input:%0A    for line in input:%0A        hit = logformat.match(line)%0A        if hit:%0A            timestamp = datetime.strptime(hit.group(1), '%25Y-%25m-%25d %25H:%25M:%25S')%0A            if abs((now - timestamp).seconds) %3C 60*window:   # 30 minute window for now%0A                active.add(hit.group(2))%0A                #print 'Activity at %25s for %25s: %25s' %25 (hit.group(1), hit.group(2), hit.group(0))%0A%0Aif len(active) %3E 0:%0A    print 'Active accounts with new columns in the last %25d minutes:' %25 window%0A%0A    conn = MongoClient('localhost', 27017)%0A%0A    accounts = %7B%7D%0A%0A    for acct in conn%5B'accounts_v1_2_2'%5D%5B'accounts'%5D.find():%0A        accounts%5Bacct%5B'accountId'%5D%5D = acct%5B'email'%5D%0A%0A    for acct in sorted(list(active)):%0A        print '  %25s (%25s)' %25 (acct, accounts%5Bacct%5D)%0A%0A    conn.close()%0A

Add in script to track new account activity