Skip to content
Browse files

try to use the sync search api

  • Loading branch information...
1 parent b922c38 commit 122cb158a19399228bef67050262881ca10e3f43 @JustinAzoff committed Apr 23, 2012
Showing with 4 additions and 8 deletions.
  1. +4 −8 splunky/splunky.py
View
12 splunky/splunky.py
@@ -60,11 +60,7 @@ def status(self, sid):
r[name] = k.text
return r
- def search_sync(self, q, check_interval=0.2, **kwargs):
- sid = self.search(q, **kwargs)
- done = False
- while not done:
- s = self.status(sid)
- done = int(s['isDone'])
- time.sleep(check_interval)
- return self.results(sid, **kwargs)
+ def search_sync(self, q, **kwargs):
+ data={'search': 'search ' + q}
+ data.update(kwargs)
+ return self.get_json("search/jobs/export", data)

0 comments on commit 122cb15

Please sign in to comment.
Something went wrong with that request. Please try again.