Purging Analytics Data

This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Purging Analytics Data

ESB Analytics stores data and performs various analysis operations on them according to defined analytic queries. Thereby, as the volume of the data stored grows over time, the analysis and summarization jobs also consumes more time. Hence, purging data allows you to increase the performance of ESB Analytics by reducing the time taken to execute the analytics scripts as well as optimizing the disk usage.

Decide on a retention period based on the number of days you need to retain data for analysis and purge data that are older than that in the below tables.

  • ORG_WSO2_ESB_ANALYTICS_STREAM_EVENT

  • ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERSECOND

  • ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERSECONDALL

  • ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERMINUTE

  • ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERMINUTEALL

  • ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERHOUR

  • ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERMONTH

  • ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERDAY

  • ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERSECOND

  • ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERMINUTE

  • ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERHOUR

  • ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERDAY

  • ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERMONTH

There are three ways to purge data in ESB Analytics:

Using the Carbon App

For EI versions 6.1.0-6.3.0, purging analytics data can be managed via the org.wso2.analytics.ei.realtime Carbon application. This application is deployed by default if you get the WUM update timestamp: 1565079455315.

For more information about WUM-updating WSO2 products, see Getting Continuous Updates.

Using the per-table method

 Follow the steps below to schedule data purging via the per-table method.

  1. Log in to the Management Console of the Analytics profile.

  2. In the Main tab, click Data Explorer to open the Data Explorer page.

  3. Select the required table in the Table Name field, and click Schedule Data Purging as shown below. 


    This opens the Schedule Data Purging dialog box.

  4. In the Schedule Data Purging dialog box, set the time and days within which you want to purge data as shown below, and click Save.

    The fields of the above screen are described below.

  5. Click Save and close the dialog box.

  6. Repeat these steps for all the required tables to schedule them to be cleared regularly.

Removing scheduled data purging operations

Follow the steps below to remove a data purging operation that you already scheduled.

  1. Log in to the Management Console as an admin user, if you are not already logged in.

  2. Click Main, and then click Data Explorer.

  3. Select the required table in the Table Name field, and then click Schedule Data Purging to open the Schedule Data Purging dialog box.

  4. Clear the Enable Data Purging check box as shown below.

    disable data purging
  5. Click Save, and close the dialog box.

Using the global method

This action affects all tenants.

  1. Open the <EI_HOME>/wso2/analytics/conf/analytics/analytics-config.xml file.

  2. Change the content under the <analytics-data-purging> property as shown below:

    <analytics-data-purging> <purging-enable>true</purging-enable> <cron-expression>0 0 12 * * ?</cron-expression> <purge-include-table-patterns> <table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_EVENT</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERSECOND</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERSECONDALL</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERMINUTE</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERMINUTEALL</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERHOUR</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERMONTH</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_STATPERDAY</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERSECOND</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERMINUTE</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERHOUR</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERDAY</table> <table>ORG_WSO2_ESB_ANALYTICS_STREAM_MEDIATORSTATPERMONTH</table> </table> </purge-include-table-patterns> <data-retention-days>2</data-retention-days> </analytics-data-purging>

    The properties of the above configuration file are shown below.

  3. Save your changes.