- URL:
- https://<root>/logs/clean
- Methods:
POST
- Required Capability:
- Access allowed with either the "Links to organization-specific group", "Delete", "Security and infrastructure", or "Servers" privileges
- Version Introduced:
- 10.9
Description
The clean
operation deletes the log files for your deployment, freeing up disk space. The logs cannot be recovered once this operation is performed.
Request parameters
Parameter | Details |
---|---|
(Optional) | The start date associated with a log, in time stamp format (
|
(Optional) | The end date associated with a log, in time stamp format (
|
(Optional) | The level of the logs that will be deleted. If no option is selected, all log messages will be deleted. Values: |
(Optional) | Introduced at 10.9.1. This parameter specifies whether the operation will run synchronously or asynchronously. If Values: |
| The response format. The default response format is Values: |
Example usage
The following is a sample POST request for the clean
operation that demonstrates deleting DEBUG
logs created within a specific date range:
POST /context/admin/logs/clean HTTP/1.1
Host: organization.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
startTime=2020-08-09-T22:45:03&endTime=2020-08-09T22:45:06logLevel=DEBUG&async=false&f=pjson&token=P4Vn2uao41gcVGxM8p3lwYgQnt9t20hRo8s4TDsH2XRtiF3xh-lNTfn1dIOaw3ke2P8nCQwjxeLV4kNiftyKCESSEPXiIbQGt9Ph7Bx_LQIGkIoXYZBNOWnOi7Fw8Z5GRg2_xYSWoLg8zzZcO3utdVsIG1Ew7Ab8f-Ti28TfUvtv7cWM9BzRaw00EtqbdJj0zu23kTYNsOO0KaXkJ5IR8wF1qGxD6-KmVyOdfC9ms51khCiq473WAo4Ho8zwkdwV
JSON Response examples
If async
is false
, the following response is returned once the logs are cleaned successfully:
{"success": "true"}
If async
is true
, the following response is returned. The value returned for jobs
can be used to access the job resource to track a job's status after it's been submitted. For more information, see the Job resource topic.
{
"jobsUrl": "https://organization.domain.com/context/admin/jobs/ja2ca1a35-881c-400c-a49a-b26883002d6c",
"jobID": "ja2ca1a35-881c-400c-a49a-b26883002d6c",
"jobStatus": "SUBMITTED"
}