Page History
The DataSync Agent can be set up to replicate table records from a Service Now instance to local file(s) on the machine where the DataSync Agent is running. This can be useful for the case where you have a separate application that is able to read files to import data.
Records can be saved in CSV, JSON, and XML formats and each record is inserted into the file (i.e. the previous version is not updated) when the Agent processes a message.
Prerequisites
First, you will need to set up the Perspectium DataSync Agent.
You should also stop running your DataSync Agent before making any Agent configuration changes.
Procedure
To enable file replication for the DataSync Agent, follow these steps:
UI Steps | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
HTML |
---|
<style>
.release-box {
height: 30px;
width: 100px;
padding-top: 8px;
text-align: center;
border-radius: 5px;
font-weight: bold;
background-color: #DDA0DD;
border-color: #FCE28A;
}
.release-box:hover {
cursor: hand;
cursor: pointer;
opacity: .9;
}
</style>
<meta name="robots" content="noindex">
<div class="release-box">
<a href="https://docs.perspectium.com/display/Helium" style="text-decoration: none; color: #FFFFFF; display: block;">
Helium
</a>
</div> |
The DataSync Agent can be set up to replicate table records from a Service Now instance to local file(s) on the machine where the DataSync Agent is running. This can be useful for the case where you have a separate application that is able to read files to import data.
Records can be saved in CSV, JSON, and XML formats and each record is inserted into the file (i.e. the previous version is not updated) when the Agent processes a message.
Prerequisites
First, you will need to set up one of the Perspectium DataSync Agents.
You should also stop running your DataSync Agent before making any Agent configuration changes.
Procedure
To enable file replication for the DataSync Agent, follow these steps:
UI Steps | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Yes | <one_record_per_file> | <one_record_per_file/> This directive will tell the agent to save each record into its own file instead of saving all records together in a single file.
<files_directory> | For Linux: <files_directory>/Downloads/subscribefiles</files_directory> For Windows: <files_directory>Users\Downloads\subscribefiles</files_directory> The directory that contains the file of the saved records | Yes | <file_prefix> | <file_prefix>record</file_prefix> A prefix for the file name of each record. If this directive is not specified, “psp.replicator.” will be used as the prefix. | No | <file_suffix> | <file_suffix>.xml</file_suffix> A suffix for the file name of each record. If this directive is not specified, “.xml” will be used as the suffix. | No | <translate_newline> | <translate_newline>nbsp</translate_newline> This directive will replace record content newline entries with a non-breaking space. | No | <enable_error_log/> | <enable_error_log/> | If a record is an invalid JSON, enabling this will create an error audit file to store all invalid JSON records, e.g. error_{table_name_timestamp}.json | No | Anchor |
multiple_file | multiple_file | Records to Multiple FilesIf you want to save your records to multiple files, use the following directives: Directive | Example | Use | Required? | <handler> | <handler>com.perspectium.replicator.file.XMLFileSubscriber</handler>
NOTE: Invalid JSON messages, such as contents not properly escaped, will be skipped. An error log will appear when this occurs. The name of the file handler class | Yes | <buffered_writes> | <buffered_writes>250</buffered_writes> A number of records to buffer before writing to file (to improve performance and not write to the file upon reading each record). NOTE: The maximum number of records in a file will be configured in this directory. Yes | <files_directory> | For Linux: <files_directory>/Downloads/subscribefiles</files_directory> For Windows: <files_directory>Users\Downloads\subscribefiles</files_directory> The directory that contains the file of the saved records | Yes | <file_prefix> | <file_prefix>record</file_prefix> NOTE: Use the value $table_$d{yyyyMMdd}_$i to set a dynamic file name where table will be the record's table, yyyyMMdd will be the date format, and i will be file number, i.e. problem_20200530_1.json. You can modify yyyyMMdd with other date format of your choice. For example, hourly will need a yyyyMMddHH value. For other date format, see Date Format.
A prefix for the file name of each record. If this directive is not specified, “psp.replicator.” will be used as the prefix. NOTE: The time period will be configured in this directory. No | <file_suffix> | <file_suffix>.xml</file_suffix>
A suffix for the file name of each record. If this directive is not specified, “.xml” will be used as the suffix. | No | <separate_files> | <separate_files>table</separate_files> Indicates that the files will be separated by table. | Yes | <enable_audit_log/> | <enable_audit_log/> | A self-closing directive that will generate an audit file. The audit file has information about when the records are processed, name of the file, and number of records processed. | No | <enable_error_log/> | <enable_error_log/> | If a record is an invalid JSON, enabling this will create an error audit file to store all invalid JSON records, e.g. error_{table_name_timestamp}.json | No | <translate_newline> | <translate_newline>%13</translate_newline> This directive will replace record content newline entries with the value you input. | Varies <file_max_size> | | Sets the maximum size for each file<file_max_size>50KB</file_max_size>
|
Similar topics
Content by Label showLabels false max 5 showSpace false sort modified cql label = "data-sync" and space = currentSpace()
|