Create Cursor
Run a query in the background mode and returns the server cursor.
Note
Be sure to delete cursors when you are done using them; any cursors that remain unused unnecessarily occupy heap memory on the Logpresso server.
Required Permissions
Requires the MEMBER role or higher.
HTTP Request
POST /api/sonar/cursors
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d q="search * limit 10" \
-X POST https://HOSTNAME/api/sonar/cursors
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| q | O | String | Logpresso query statement |
Success Response
{ "id": 109 }
- id (32-bit integer): ID of query in background mode
Error Responses
Missing argument
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "q should be not null"
}
Invalid query
HTTP status code 400
{
"error_code": "invalid-query",
"error_msg": "(10200) missing-json-quotation"
}