Software AG Products 10.11 | Integrate Software AG Products Using Digital Event Services | webMethods API Gateway Documentation | Administrating API Gateway | Operating API Gateway | Data Management | Data housekeeping | Archive and purge using UI | Purging Data
 
Purging Data
Pre-requisites:
To purge data from the API Gateway database, you must have the Manage purge and restore runtime event functional privilege in API Gateway.
Purging is the process of systematically deleting unwanted data from the database. You can purge data based on the type of data or the age of the data in the API Gateway database.
*To purge data
1. Expand the menu options icon , in the title bar, and select Administration.
2. Select Manage Data.
3. Click Archive and purge.
4. Select the event types for which the data has to be purged.
The available options are:
*ALL
*Audit logs
*Error events
*Lifecycle events
*Monitor events
*Performance metrics
*Policy violation events
*Threat protection events
*Transaction events
*Application logs
*Mediator trace span
*Server log trace
*Request response trace
5. Select Purge.
6. Select one of the following options to purge (delete) the required data.
*Select Range. Select a period during which you want the data to be purged.
*To purge selected types of data from a particular date till the current date, select the required date in the From date field.
*To purge selected types of data from the beginning (events start date) till a particular date, select the required date in the To date field.
If you select both From date and To date, all the data in the selected range is archived.
*Select Older than. Type a number and a time period. For example, if you type 1Y, data older than 1 year is selected for purging. If you select 1M, data older than one month is selected for purging.
7. Click Submit.
Once you click the Submit button, the purge operation is triggered and a job is created in the job table. You can monitor the status of the purge operation, in the job table.
Important:
API Gateway does not perform the purge operation immediately. Once you click the Submit button, API Gateway starts to mark the files for deletion. Once all the files are marked, the status of the purge operation shows 100% and this implies that the files are deleted internally. However, the actual disk space which was occupied by the purged files is not freed-up, even after the purge status shows 100%. When the purge status is 100% it implies that the files are internally deleted and it may take up more time to free up the disk space.
If you want to free up the disk space immediately, you can use the following REST API, once the purge operation status shows 100%. This REST API must be executed on Data store or Elasticsearch. The syntax is:
POST /<target>/_forcemerge?only_expunge_deletes=true
, where
*<target>. is the comma-separated list of data streams, indices, and aliases used to limit the request. This parameter supports wildcards (*). To target all data streams and indices, exclude this parameter or use * or _all.
*only_expunge_deletes. is a boolean parameter. When set to True, it expunges only those segments containing document deletions.
You can use the Force Merge API on the following indices:
*Transaction events (gateway_default_transactionalevents)
*Lifecycle events (gateway_default_lifecycleevents)
*Performance metrics (gateway_default_performancemetrics)
*Monitor events (gateway_default_monitorevents)
*Threat Protection events (gateway_default_threatprotectionevents)
*Policy violation events (gateway_default_policyviolationevents)
*Error events (gateway_default_errorevents)
*Audit events (gateway_default_auditlogs)
*Application logs (gateway_default_log)
*Mediator trace span (gateway_default_mediatortracespan and gateway_default_serverlogtracespans)
To learn more about this API, you can refer to Elasticsearch documentation on Force Merge API.
Note:
You can also use the REST API to archive data. For more details, see API Gateway AdministrationAPI Gateway Administration. In this API, you can use the
DELETE/rest/apigateway/apitransactions
method to purge data. This method returns the job id as response and the job id is used to track the job status.