Info: This feature requires Assets Server 6.70 or higher.
The Stats cleanup API provides multiple ways for cleaning up stats indices or their content.
Stats index cleanup API
|
Assets Server 6.122 or higher: POST /controller/admin/stats/cleanup Assets Server 6.70 – 6.121: GET/POST /controller/admin/stats/cleanup |
Removes specified stats indices.
Note: It is not allowed to remove the current month’s index.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| indices | string |
Comma-separated list of stats indices to remove. Required. |
stats-202101-r1,stats-202102-r1,stats-202103-r1, stats-202104-r1,stats-202105-r1 |
Example
| Index name | Result |
|---|---|
| stats-202101-r1 | success |
| stats-202101-r2 | failure |
| stats-202501-r1 | not exist |
| assets-r1 | not allowed |
| stats-202108-r1 | not allowed (active) |
| stats-202103-r1 | not allowed (backup in progress) |
Stats history cleanup API
|
Assets Server 6.122 or higher: POST /controller/admin/stats/removeHistory Assets Server 6.70 – 6.121: GET/POST /controller/admin/stats/removeHistory |
Removes stats entries related to files that are not in the system anymore.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| age | integer |
Minimal age in days of stats entries to be checked. Optional. When not specified, all entries are affected. |
365 |
Stats index close API
Info: This feature requires Assets Server 6.123 or higher.
|
POST /controller/admin/stats/close |
Closes specified stats indices.
A closed index stays on disk but is not loaded by Elasticsearch, which reduces its memory use.
Note: It is not allowed to close the current month's index, or to close an index while an Elasticsearch backup is in progress.
Stats indices can also be closed automatically with the statsIndexRetentionMonths setting. When it is set to N, the indices older than N months will be automatically closed. When it is empty (default), no indices are closed automatically.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| indices | string |
Comma-separated list of stats indices to close. Required. |
stats-202101-r1,stats-202102-r1,stats-202103-r1 |
Example
| Index name | Result |
|---|---|
| stats-202101-r1 | success |
| stats-202101-r2 | failure |
| stats-202501-r1 | not exist |
| assets-r1 | not allowed |
| stats-202108-r1 | not allowed (active) |
| stats-202103-r1 | not allowed (backup in progress) |
Stats index open API
Info: This feature requires Assets Server 6.123 or higher.
| POST /controller/admin/stats/open |
Opens specified closed stats indices. After opening, statistics in the index are included in results again.
Note: When statsIndexRetentionMonths is set, an opened index older than the retention period is closed again at the next automatic weekly run.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| indices | string |
Comma-separated list of stats indices to open. Required. |
stats-202101-r1,stats-202102-r1,stats-202103-r1 |
Example
| Index name | Result |
|---|---|
| stats-202101-r1 | success |
| stats-202101-r2 | failure |
| stats-202501-r1 | not exist |
| assets-r1 | not allowed |
Usage stats cleanup API
|
Assets Server 6.122 or higher: POST /controller/admin/stats/removeUsage Assets Server 6.70 – 6.121: GET/POST /controller/admin/stats/removeUsage |
Removes entries from StatsUsage based on the given criteria.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| actions | string |
Comma-separated list of actions. Optional. |
METADATA_UPDATE, CREATE |
| users | string |
Comma-separated list of users. Optional. When not specified, the current user name is used. |
admin, server |
| age | integer |
Minimal age in days of stats entries to be checked. Optional. When not specified, all entries are affected. |
365 |
Search stats cleanup API
|
Assets Server 6.122 or higher: POST /controller/admin/stats/removeSearch Assets Server 6.70 – 6.121: GET/POST /controller/admin/stats/removeSearch |
Removes entries from StatsSearch on the given criteria.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| clientTypes | string |
Comma-separated list of client types. Optional. |
proWeb, api |
| users | string |
Comma-separated list of users. Optional. When not specified, the current user name is used. |
admin, server |
| age | integer |
Minimal age in days of stats entries to be checked. Optional. When not specified, all entries are affected. |
365 |
Activity stats cleanup API
| POST /controller/admin/stats/removeActivity |
Removes entries from StatsActivity on the given criteria.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| activityTypes | string |
Comma-separated list of activity types. Optional. |
LOGIN, LOGOUT |
| clientTypes | string |
Comma-separated list of client types. Optional. |
proWeb, api |
| users | string |
Comma-separated list of users. Optional. When not specified, the current user name is used. |
admin, server |
| age | string |
Minimal age in days of stats entries to be checked. Optional. When not specified, all entries are affected. |
365 |
Monitoring operations
Info: This feature requires Assets Server 6.122 or higher.
The following operations run asynchronously and return the ID of the started process in the Server Status page of the Management Console under Processes > Running.
- removeActivity
- removeHistory
- removeSearch
- removeUsage
Their progress can be observed and canceled from the Management Console.
Their output is added to the server log:
|
Example: INFO com.ds.acm.info.StatsHistoryCleanup - Stats history cleanup: age=0, endDate=Mon Jun 15 13:44:55 UTC 2026, statsIndexCount=3 INFO com.ds.acm.info.StatsHistoryCleanup - Stats history cleanup index=stats-202604-r1: matchedDocs=245, uniqueAssetIds=219, orphaned=200, docsToDelete=200, failedShards=0 INFO com.ds.acm.info.StatsHistoryCleanup - Stats history cleanup index=stats-202606-r1: matchedDocs=515, uniqueAssetIds=235, orphaned=200, docsToDelete=200, failedShards=0 INFO com.ds.acm.info.StatsHistoryCleanup - Stats history cleanup index=stats-202605-r1: matchedDocs=232, uniqueAssetIds=222, orphaned=200, docsToDelete=200, failedShards=0 INFO com.ds.acm.info.StatsHistoryCleanup - Stats history cleanup finished: deleted=600, failedShards=0 |
Revisions
- 17 November 2026: Updated section 'Stats index cleanup API' by adding example 'stats-202103-r1'.
- 17 November 2026: Added section 'Stats index close API'.
- 17 November 2026: Added section 'Stats index open API'.
Comments
0 comments