Configuring data retention and index rollover time periods
You can set a time period for data retention and index rollover using the Advanced Analytics Configuration option for an analytics service.
Before you begin
This task assumes you have registered an analytics service and associated it with a gateway service. See Registering an analytics service and Associating an analytics service with a gateway service.
One of the following roles is required to set the Data Retention and Index Rollover values:
- Administrator
- Topology Administrator
- Owner
- A custom role with the
topology:manage
permission
About this task
Each API call is recorded as a document in a shared index. Periodically, a new index is created and the previous index is stored. You can specify Index Rollover and Data Retention settings that control how often new indexes are created, and how long indexes are stored.
The Index Rollover settings determine how long an index accumulates data before it "rolls over" into storage and a new index is created. You can control the duration of an index two ways: by setting a maximum age for the index (default is 1 day), and by setting a maximum number of documents that can be recorded in the index (default is 25 million documents). When the rollover occurs, a new index is created and documents are recorded there, while the previous index is stored until its age exceeds the Data Retention setting. If you change the rollover settings, consider both the amount of data being stored within each index as well as the number of indexes being stored. Allowing indexes to grow too large, or storing too many indexes at once, might cause issues.
The Data Retention setting determines how long the stored indexes (and the data they contain) are retained. Once every day, all indexes that are older than the specified retention period are purged. Retention is based on the index's age, not the age of the data within that index. When the index's own creation date exceeds the retention period, the index and all its data is deleted even if some of the data stored in that index is younger than the retention period. Data is purged by deleting entire records so you cannot choose to delete only certain fields.
The default retention period is 90 days. Reasons for changing this setting include storage constraints, and data retention requirements for your organization. You might want to set this value to be less than the default if a large number of API events are stored, especially if payload logging is enabled on the APIs. Although there is no hard retention limit, we do not recommend exceeding 10 years (approximately 3650 days). If you modify the retention value, you should modify the index rollover setting as well to ensure that they remain in sync.
The most recently created index (the index that is currently being written to) is not deleted, even if you set the retention period as small as 1 hour. If you regularly need to delete data quickly, adjust the Index Rollover setting so that a new index is rolled over to sooner, and the old index can be deleted.
To change the data retention and index rollover settings, you must configure you settings in the Cloud Manager, and then edit the schedule in the related cronjob as explained in the following procedure.