I. Overview
1. Version
Designer | JAR | Platform log sync to other databases plugin |
---|---|---|
10.0 | 2020-05-06 | V1.0.0 |
2. Application scenarios
Currently LogDB does not support migration. If users want to perform some complex analysis on log, it is troublesome, and hope that the log can be migrated to their own database for management and analysis.
The user wants to put the logs of each system in the same place for operation and maintenance management.
3. Function introduction
After installing the "Platform log sync to other databases" plugin, users can periodically sync part of the table data in LogDB to other databases through settings.
II. Plugin introduction
1. Install the plugin
Click to download the plugin: com.fr.plugin.log.sync-1.0.7.zip
Designer plugin installation method reference: Plugin Management
Server installation plugin method reference: Server plugin management
2. Databases that support migration
Databases | JAR version | Support database version |
---|---|---|
MySQL | Unlimited | 5.1.73、5.5.31、5.5.46、5.5.56、5.6.22、5.6.31、5.7.16 |
SQL Server | Unlimited | 2000、2005、2008、2012、2014、2016 |
2019-02-28 | 2017 | |
Oracle | Unlimited | 10g、11g、12c、9i |
3. Log sync
After the plugin is installed successfully, click "Manage>Intelligent Operations>Platform Log", and the "Log Sync" tab is added to the platform log interface, as shown in the following figure:
III. Example
1. Select the logs to be synchronized
1) Enter the decision-making platform as an administrator, click "Manage>Intelligent Operations>Platform Log", and click "Set up log sync task" in the "Log Sync" Tab page, as shown in the following figure:
2) In the log sync settings, select "Sync log start time", tick the logs that need to be synchronized, and click "Next". As shown below:
The log tables that support synchronization include:
Report execution log fine_record_execute
Login log fine_record_login
Mail sending log fine_record_email
Fill in the log fine_record_write
SMS sending log fine_record_sms
Management behavior log fine_record_operate
Application real-time situation fine_real_time_usage
gc log fine_record_gc
Function usage fine_intelli_focus_point
2. Configure database information
Fill in the relevant information of the database to which the log data will be migrated, and click "OK", as shown in the figure below:
3. Restart the server
After the plugin configuration is completed, the server needs to be restarted for the configuration to take effect.
IV. View effect
1. Sync status
Note: The sync interval is 3 minutes, and each table can sync at most thirty thousand data at a time.After the sync is successful, the sync status is as shown in the figure below:
1) Notify the administrator when sync failsIf you check the "Notify the administrator when sync fails" button, the administrator will receive a platform message when the sync fails.
2) Pause syncYou can click the "Pause" button to pause sync. As shown below:
3) Edit sync settingsWhen sync is suspended or failed, you can click the "Edit" button to edit the sync task again. As shown below:
"Start time effective object" setting description:
If you want all the checked tables to be synced from the "Sync log start time" set by the user, then the "Start time effective object" is set to "All sync logs";
If you want to sync only the newly added table from the setting value of "Sync log start time", and the remaining synced tables will continue to sync from the place where they were synced before, then the "Start time effective object" is set to "Only valid for the log of this change";
If you want to suspend the sync of some tables and continue to sync the rest of the tables where they were synced before, set the "Start time effective object" to "Only valid for the log of this change", and then uncheck the need to pause the sync table .
4) View sync detailClick the "View sync detail" button to view the sync details. As shown below:
Note: At the beginning of the sync period, because the system is searching for data in the database, the "The amount of data synced last time" will be displayed as 0.
Only show the running status of the last sync task. The description of each field is shown in the following table:
Field name | Description |
---|---|
Sync table | Selected sync log |
Sync log deadline | In the last sync task that has been executed, the latest time of the log in to the database indicates that the logs between the "sync log start time" and this point in time have been stored in the database |
Last sync time | The start execution time of the sync task at the end of the last execution |
The amount of data synced last time | The number of log records synced by the sync task at the end of the last execution |
Last sync time | The time it takes to execute the sync task at the end of the last execution |
Operation result | Successful/Fail If the operation result is "Fail", you can click to view the specific error report |
2. Platform log sync to database
The log data is synced to the set database. As shown below:
Note: The content in the field can be stored if it is too long, but the content exceeding 255 characters will be truncated.
The synced table has a new self-increasing primary key (syncID) and a timestamp field (storageTime). An example is shown in the following figure:
When the field name uses the database reserved name, in order to be compatible with each version, alias the reserved name. The specific fields for rename processing are as follows:
Table | Original field name | Field name after migration |
---|---|---|
FINE_RECORD_OPERATE | type | operateType |
resource | operateResource | |
status | operateStatus | |
FINE_RECORD_EXECUTE | type | executeType |
sql | query | |
sqlTime | queryTime | |
FINE_RECORD_WRITE | sql | query |
sqlTime | queryTime |