Fetch Cursor
Fetchs the result of a specified query.
Required Permissions
Requires the MEMBER role or higher.
HTTP Request
GET /api/sonar/cursors/:id
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
"https://HOSTNAME/api/sonar/cursors/109?offset=0&limit=10"
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| id | O | 32-bit integer | Logpresso query ID | |
| offset | X | 64-bit integer | Number of records to skip | Minumum: 0. Default: 0. |
| limit | X | 64-bit integer | Maximum number of records to load | Minimum: 0. Default: 1000. |
| format | X | String | Output format | One of the following: html, txt, xml, csv, json, json-single. |
Success Response
Below is an example of a response from the system tables | fields table query. If format is not specified, it is returned in newline-delimited JSON format.
\{"table":"sonar_event_00001"}
{"table":"sonar_raw_event_00001"}
If you specify the offset equal to or greater than the total number of query results, nothing will be retrieved. offset value must be smaller than the rows value from Get Query Status.
Error Responses
Failed to fetch a specified cursor
HTTP status code 403. If the query does not exist or is executed by another user account, you can't fetch the cursor.
{
"error_code": "invalid-query-id",
"error_msg": "cannot access query 42"
}
Query ID is not an integer
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "query id should be integer type"
}
offset or limit value is not an integer
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "offset should be long type."
}
offset or limit value is negative
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "offset should be non-negative integer."
}
Invalid format value
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "format should be one of html, txt, xml, csv, json or json-single."
}