Software AG Products 10.11 | Administrating API Gateway | Operating API Gateway | Data Management | Data Backup | Advanced Backup Options | Creating Rollover of an Index
 
Creating Rollover of an Index
When data on a particular index exceeds a certain limit, it is essential to rollover the index and create a new index. In API Gateway, it is essential to monitor the indexes for transactional events. For transactional events, you must rollover the index, when the index size exceeds 25 GB. When an index is rolled over, a new index is created with two primary and a replica for each shard.
You can perform rollover for the following indexes:
*performancemetrics
*policyviolationevents
*monitorevents
*errorevents
*threatprotectionevents
*transactionalevents
*lifecycleevents
*auditlogs
*log
*serverlogtrace
*mediatortrace
*requestresponsetrace
*To create rollover of an index
1. From the command prompt, go to SAGInstallDir/IntegrationServer/instances/default/packages/WmAPIGateway/cli/bin.
Note:
Replace default with the corresponding instance name.
2. Run the following command to create a backup of specific indexes in the default location:
Linux
./apigatewayUtil.sh rollover index -type name of the index to roll over
Windows
apigatewayUtil.bat rollover index -type name of the index to roll over
The following sample shows the roll over of index, performancemetrics, on Windows.
C:\SoftwareAG\IntegrationServer\instances\default\packages\WmAPIGateway\cli\bin>apigatewayUtil.bat rollover index
-type performancemetrics

Rollover is completed successfully
Old Index: gateway_default_analytics_performancemetrics_202108140608
New Index: gateway_default_analytics_performancemetrics_202108140612
Rolled over: true
Dry Run: false
Conditions: [{}]
You can include the following optional parameters to customize the roll over command as per your requirements.
Parameter
Description
tenant
Name of the tenant in which the data exists.
If you do not provide this parameter, the value is picked from pg.gateway.elasticsearch.tenantId property in config.properties file located at IntegrationServer\instances\instance_name\packages\WmAPIGateway\config\resources\elasticsearch.
targetIndexSuffix
Suffix to be included in the name of the rolled over index. If you do not provide this parameter, the rollover timestamp is added as a suffix to the rolled over index. You can provide a suffix such as the date distinguish the index.
For example, if you provide the following command:
apigatewayutil.bat rollover index
-type performancemetrics -targetIndexSuffix 15aug2021
the suffix is added to the rolled over index
Rollover is completed successfully
Old Index: gateway_default_analytics_performancemetrics_14aug2021
New Index: gateway_default_analytics_performancemetrics_15aug2021
Rolled over: true
Dry Run: false
Conditions: [{}]
dryRun
Option to check whether the current index matches with any of the specified conditions.
Possible values are:
*true. Performs check on the current index against the specified conditions.
*false. Does not check the current index. This is the default value and the value of the parameter is considered as false, if do not specify this parameter.
You can specify one of the conditions listed in the Conditions that can be given with rollover command section.
For example, to check if the size of the current log index is 6 GB, you can run the command as seen here:
apigatewayutil.bat rollover index -type
log -dryRun true -maxSize 6GB
Sample result:
Dry run executed successfully.
Old Index: gateway_default_log_1628582905777-000001
New Index: gateway_default_log_202108271018
Rolled over: false
Dry Run: true
Conditions: [{[max_size: 6gb]=false}]
Note:
This parameter does not perform rollover. It displays results based on the check performed.
logLevel
Level of log that you want to create. Log levels indicate the severity of logs. Available levels are:
*Info. Provides the list of regular events that occur during the process. These events are informative.
*Debug. Provides the events that could be useful, if you have to debug the process.
*Warning. Indicates unexpected events that occurred during the process. Usually, these events do not interrupt or have an immediate effect on the process.
*Error. Indicates the events that stop the functionality from working as designed.
*Trace. Provides the list of events in a much detailed manner that could be useful for debugging.
You can specify one of the log level with the logLevel parameter. For example, to create a log file of Warning level when listing backup files, you can run the following command:
apigatewayUtil.bat list backup -logLevel warning
When you provide Error as the log level, then only the error level logs are saved. When you provide Debug as the log level, then Debug, Info, Warning and Error level logs are saved. When you provide Trace as log level, then all level logs are saved.
This parameter is optional. If you do not specify the parameter, then the Info level logs are saved by default.
logFileLocation
Location where you want to save the log file.
For example, to save the log file in C:/apiglogs/backups, you can provide the location as seen in the following example:
apigatewayUtil.bat create backup -name samplebackup
-logFileLocation C:/apiglogs/backups
This parameter is optional. If you do not specify the parameter, the logs are saved in the following location SAGInstallDir/IntegrationServer/instances/instance_name/packages/WmAPIGateway/cli/logs/APIGWUtility.log.
The specified indexes are rolled over when any one of these conditions is satisfied.