SumoLogic/sumologic-python-sdk

search-job-messages.py: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url

Closed this issue · 0 comments

Hi guys,

I'm looking into this sdk to understand how it all works. In general I will need to get all data and push it to my system.

I'm executing script like this:

$ cat query.sumoql | python search-job-messages.py <secret_id> <secret_key> `date +%s000` $(echo | awk "{print 1000+`date +%s000`}") EEST                     Traceback (most recent call last):
  File "search-job-messages.py", line 31, in <module>
    sj = sumo.search_job(q, fromTime, toTime, timeZone)
  File "build/bdist.cygwin-2.6.0-x86_64/egg/sumologic/sumologic.py", line 67, in search_job
  File "build/bdist.cygwin-2.6.0-x86_64/egg/sumologic/sumologic.py", line 52, in post
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 862, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.us2.sumologic.com/api/v1/search/jobs

Ivan.