def log_search_user(): print("log_search_user starts: %s" % (datetime.now())) db_name = unicode(request.args.get('db_name')) username = unicode(request.args.get('username') or '') #print(u"db_name=%s, username=%s" % (db_name, username)) (requests, count_processed) = s.search_by_username(db_name, username) return render_template('log_search_user.html', \ requests = requests, \ db_name = db_name, \ db_names = s.get_db_names(), \ username = username, \ count = count_processed)
try: time_to = datetime.strptime(query_time_to, '%H:%M') except Exception, e: # time_to = N logging.debug(e) skip = int(request.args.get("skip") if request.args.get("skip") else 0) rpp = int(request.args.get("rpp") if request.args.get("rpp") else 10) requests = s.search_by_params(cURL = query_path, cU = query_username, \ cIP=query_ip, cQS=query_qs, \ db_date = query_date, \ tE_min = time_from, tE_max = time_to, \ skip=skip, limit=rpp) return render_template('index.html', requests = requests, \ skip = skip, rpp = rpp, dates = \ [db_name.strip('ati_log_') for db_name in [''] + s.get_db_names()]) # @app.route('/_get_more_rows', methods = ['GET']) # def get_more_rows(): + # return jsonify(result = s.search(q)) # # def get_more_rows(guid, q, skip, count): # # s.search(q) @app.route('/_get_more_info', methods = ['GET']) def get_more_info(): db_date = request.args.get('db_date') row_id = request.args.get('row_id') # print(db_date, row_id) row = s.search_by_id(db_date, row_id) fields = {'client ip':row['cIP'], \ 'server ip':row['sIP'], \