示例#1
0
 def get(self):
     search = self.get_argument("search")
     search = ezsearch.expand(search) if options.enable_ezsearch else search
     sync_search = "%s%s%s" % (options.splunk_search_query_prefix, search, options.splunk_search_sync_query_suffix)
     sync_spawn_process = "1" if options.splunk_search_sync_spawn_process else "0"
     self.set_header("Expires", datetime.datetime.utcnow() + datetime.timedelta(days=365))
     self.async_request("/services/search/jobs/oneshot", self._on_create, session_key=self.session_key, 
                        count=options.splunk_search_sync_max_count, max_count=options.splunk_search_sync_max_count, 
                        search=sync_search, spawn_process=sync_spawn_process, segmentation=options.splunk_search_segmentation)
示例#2
0
 def get(self):
     sid = self.get_argument("sid", None)
     if sid:
         self.buffer = web.BufferedWriter(4, self._on_finish)
         self.async_search_delete(sid)
     else:
         self.buffer = web.BufferedWriter(3, self._on_finish)
     search_argument = self.get_argument("search")    
     search_string = ezsearch.expand(search_argument) if options.enable_ezsearch else search_argument
     self.sync_search_create(search_string)
     self.async_search_create(search_string)
     self.buffer.write(0, self.render_string("search/_search.html", search=search_argument))