Delete an optimizer
DELETE/v1/triggers/:id
Deletes an optimizer and returns it. The data it already wrote stays in the timeless account: to remove it, run Delete data from a timeless account with the optimizer's ID first.
Must be run with an API token that has the User or Admin role. API tokens created before token roles were introduced have the same permissions as Admin.
Please ensure to change the region in the URL to match your account's region.
Request
Path Parameters
The id of the optimizer. Get it from List the optimizers of an account.
Responses
- 200
- 403
- 404
successful operation. Returns the deleted optimizer.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
The ID of the optimizer. Leave it out when you create an optimizer. When you update one, leave it out or set it to the ID in the URL.
The name of the optimizer
A description of the optimizer
Whether the optimizer runs. Defaults to true.
search objectrequired
The search the optimizer runs. Without groupBy and metricsAggregations, each run copies the matching documents into the timeless account. With them, each run writes the aggregated results instead.
The search query, in Lucene syntax. Use * to match every document.
Optional extra filters, as a JSON-encoded Elasticsearch query DSL bool query.
Fields to group the results by
metricsAggregations object[]
Aggregations to compute for each group. With groupBy, every aggregation needs an aggregationType other than NONE.
Possible values: [SUM, MIN, MAX, AVG, COUNT, UNIQUE_COUNT, PERCENTAGE, PERCENTILE, NONE]
The field to aggregate. Leave it empty only for COUNT.
The value the aggregation needs, for aggregations that take one, such as PERCENTILE
How far back each run searches, in minutes. Leave it out to search back as far as the schedule's interval, so consecutive runs cover all the data once.
source object
The accounts the optimizer searches. It must search at least one account.
Search the account that owns the API token in the request and all the accounts it can search. Defaults to true. To search specific accounts, set it to false and list them in subAccountsIds.
The IDs of the accounts to search, when allSubAccounts is false
Also search all your timeless accounts. Defaults to false.
The IDs of timeless accounts to search, when allTimelessIndices is false
triggerOn objectrequired
When the optimizer runs
Possible values: [SCHEDULE]
Always SCHEDULE for an optimizer
Possible values: [EVERY_10_MINUTES, EVERY_30_MINUTES, EVERY_1_HOUR, EVERY_4_HOURS, EVERY_6_HOURS, EVERY_8_HOURS, EVERY_1_DAY]
How often the optimizer runs
output objectrequired
target objectrequired
timelessIndex objectrequired
The timeless account the optimizer writes into
The id of the timeless account, from List the timeless accounts of an account
The log type to write with. Use the timeless account's logType: data written with any other log type can't be removed with Delete data from a timeless account.
The name of the timeless account
The time at which the optimizer was created, in epoch seconds
Who created the optimizer
The time at which the optimizer was last updated, in epoch seconds
Who last updated the optimizer
{
"id": 1001,
"name": "Checkout errors",
"description": "Keeps checkout service errors for audits",
"enabled": true,
"search": {
"queryString": "type: checkout AND level: ERROR",
"filter": "{\"bool\":{\"must\":[],\"must_not\":[{\"match_phrase\":{\"env\":{\"query\":\"staging\"}}}]}}",
"groupBy": [
"service"
],
"metricsAggregations": [
{
"aggregationType": "COUNT",
"fieldToAggregateOn": "",
"valueToAggregateOn": "string"
}
],
"periodInMinutes": 10,
"source": {
"allSubAccounts": false,
"subAccountsIds": [
11111
],
"allTimelessIndices": false,
"timelessIndices": []
}
},
"triggerOn": {
"type": "SCHEDULE",
"frequency": "EVERY_10_MINUTES"
},
"output": {
"target": {
"timelessIndex": {
"id": 22222,
"logType": "error-logs-archive",
"name": "error-logs-archive"
}
}
},
"createdOn": 1793263548,
"createdBy": "test.user@example.com",
"lastUpdatedOn": 1793263548,
"lastUpdateBy": "test.user@example.com"
}
Forbidden. The API token in the request has the Read only role, or the optimizer belongs to another account.
- application/json
- Schema
- Example (from schema)
Schema
The HTTP status code
The ID of the request, for Logz.io support
{
"code": 403,
"message": "Insufficient privileges",
"requestId": "0e1f7a3b-2b6c-4a63-9b4e-6d1c2f0a9e11"
}
Not Found. No optimizer with this ID exists.
- application/json
- Schema
- Example (from schema)
Schema
The HTTP status code
The ID of the request, for Logz.io support
{
"code": 403,
"message": "Insufficient privileges",
"requestId": "0e1f7a3b-2b6c-4a63-9b4e-6d1c2f0a9e11"
}