@@ -0,0 +1,1344 @@
+import argparse%0Aimport subprocess%0A%0ABASE_DIR = '/path/to/data'%0A%0Adef exec(time, match, count, verbose):%0A    if count:%0A        cmd = 'parallel sqlite3 ::: %25s/%25s ::: %22select count(*) from syslog where logs match %5C'%25s%5C';%22' %25 (BASE_DIR, time, match)%0A        # debug code%0A        # cmd = 'parallel sqlite3 ::: /mnt/ssd1/benchmark-db/100k/100k-1.db ::: %22select count(*) from syslog where logs match %5C'noc%5C';%22'%0A    else:%0A        cmd = 'parallel sqlite3 ::: %25s/%25s ::: %22select * from syslog where logs match %5C'%25s%5C';%22' %25 (BASE_DIR, time, match)%0A        # debug code%0A        # cmd = 'parallel sqlite3 ::: /mnt/ssd1/benchmark-db/100k/100k-1.db ::: %22select * from syslog where logs match %5C'noc%5C';%22'%0A%0A    if verbose:%0A        print(cmd)%0A%0A    subprocess.call(cmd, shell=True)%0A%0Aif __name__ == '__main__':%0A    parser = argparse.ArgumentParser()%0A    parser.add_argument(%22--time%22,%0A                        help=%22time explain regexp(YYYY/MM/DD/HH/MIN). eg: 2017/04/27/10/*%22)%0A    parser.add_argument(%22--match%22,%0A                        help=%22matching keyword. eg: noc or 'noc Login'%22)%0A    parser.add_argument(%22-c%22,%0A                        help=%22count%22, action=%22store_true%22)%0A    parser.add_argument(%22-v%22,%0A                        help=%22verbose%22, action=%22store_true%22)%0A    parser.parse_args()%0A%0A    args = parser.parse_args()%0A%0A    exec(args.time, args.match, args.c, args.v)%0A

add search_engine.py