Save your agent.xmlSave the changes you've made to your agent.xml and close the file. An example agent.xml configuration for an AWS S3 Subscriber Agent is shown below: <?xml version="1.0" encoding="UTF-8"?>
<config>
<agent>
<share />
<subscribe>
<task>
<task_name>s3_agent_subscribe</task_name>
<message_connection password="password" user="user">https://mesh.perspectium.net</message_connection>
<instance_connection password="password" user="user">https://myinstance.service-now.com</instance_connection>
<handler>com.perspectium.replicator.file.S3Subscriber</handler>
<decryption_key>The cow jumped over the moon</decryption_key>
<access_key>AccessKey</access_key>
<secret_access_key>SecretAccessKey</secret_access_key>
<region>us-west-2</region>
<s3_bucket>examples3bucket</s3_bucket>
<file_format>json</file_format>
</task>
</subscribe>
<polling_interval>40</polling_interval>
</agent>
</config> |
Files saved in the AWS S3 bucket will be named <task_name>.<randomized_unique_identifier>.<file_format>. A randomized unique identifier is used to ensure there are no file naming collisions when saving to the S3 bucket. Using the above configuration example, a file would be named s3_agent_subscribe.00b470b7-901c-4447-9316-023a265d632f.json.
NOTE: In this configuration example, your data records will be saved in your AWS S3 bucket as one file. To save each record from your app as an individual file in your AWS S3 bucket, use the following agent.xml configuration example as a guide: <?xml version="1.0" encoding="UTF-8"?>
<config>
<agent>
<share />
<subscribe>
<task>
<task_name>s3_agent_subscribe</task_name>
<message_connection password="password" user="user">https://<customer>.perspectium.net</message_connection>
<instance_connection password="password" user="user">https://<instance>.service-now.com</instance_connection>
<handler>com.perspectium.replicator.file.S3Subscriber</handler>
<decryption_key>The cow jumped over the moon</decryption_key>
<access_key>AccessKey</access_key>
<secret_access_key>SecretAccessKey</secret_access_key>
<region>us-west-2</region>
<s3_bucket>examples3bucket</s3_bucket>
<file_format>json</file_format>
<file_prefix>record_</file_prefix>
<file_suffix>.json</file_suffix>
<one_record_per_file/>
</task>
</subscribe>
<polling_interval>40</polling_interval>
</agent>
</config> |
Saving one record per file supports the following configuration directives: Directive | Example | Description | Required? | <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. If you choose to specify a prefix with a $table token, e.g. psp_$table_, the token will be replaced by the table name of the record. For example, if you have <file_prefix>psp_$table_</file_prefix> configured, and an incident record is being processed, the filename will result to the following psp_incident_5f82dfaf-cf30-4b37-8f02-94248ge7orvi. | No | <file_suffix> | <file_suffix>.xml</file_suffix> | A suffix for the file name of each record. If this directive is not specified, “.json” will be used as the suffix. | No |
In this case, each record will be saved in its own file named<file_prefix><randomized_unique_identifier><file_suffix>. Using the above configuration example, a file would be named record_00b470b7-901c-4447-9316-023a265d632f.xml. |