Error code 500 when posting to search job API for the FIRST time to get job id

Comments

3 comments

  • Avatar
    Vidudaya Bandara

    Got resolved this issue. 

  • Avatar
    Mario Sanchez

    Vidudaya,

    Great to hear you resolved the issue. Can you share what the resolution was?

    Thanks!

     

  • Avatar
    Vidudaya Bandara

    As it says we need to send 4 query parameters in the request. So first I append those to the url looked like the one in the bottom of the question.

    Actual URL : https://api.us2.sumologic.com/api/v1/search/jobs?query=| count _sourceCategory&from=2017-07-01T12:00:00&to=2017-07-19T23:10:00&timeZone=PST

    But it didn't work out so I tried to send a json in the request body with content-type 'application/json' . In your sample POST you have a 

    createSearchJob.json 

    which has content like,

    {
      "query": "| count _sourceCategory",
      "from": "2013-01-28T12:00:00",
      "to": "2013-01-28T13:10:00",
      "timeZone": "PST"
    }

    So I set the same in the content body which apparently worked for me ,

    And I got a 202 and got your response with a jobID and a link like you described in the documentation.

    And also now I can page through the messages as well. 

    https://api.sumologic.com/api/v1/search/jobs/SEARCH_JOB_ID/records?offset=OFFSET&limit=LIMIT

    is working now.

     

    All those got resolved through Restlet client in Chrome. Now have to replicate that in a custom environment. 

Please sign in to leave a comment.