Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saved search added and tested #5

Open
wants to merge 10 commits into
base: master
from
Next

added the query to saved search, not yet functional

  • Loading branch information
mnuyens committed Jun 4, 2012
commit 7312f7cd14154209348f79462a282be3d67b658b
@@ -103,6 +103,24 @@ def facets(self, q='*', facetby='date', **kwargs):
kwargs['q'] = q
return self._api_help('api/facets/%s' % facetby, kwargs)

@time_translate
def savedsearch(self,q="",**_kwargs):
"""
Runs one of your saved searches
"""
query=Http(timeput=10)
resp, cont=query.request("http://"+self.subdomain+"loggly.com/api/savedsearches","GET")
content=json.loads(cont)
saved=None
for search in content:
if search['name']=q:
saved=search
if saved==None:
raise ValueError("Your account does not have a search of that name,\
please go to "+self.subdomain+".loggly.com to check your saved searches")



def create_input(self, name, service='syslogudp', description='',
json=False):
'''Creates a new input on your loggly account. Service can be any of:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.