Publish Data to an FTP Server
January 11, 2016
After an agent runs successfully, you can have the results delivered to an external server using file transfer protocol (FTP). Follow these steps to publish your data using FTP.
Open the agent or collection in the Web Console.
Open the Tools 🔨 menu.
Choose an option under What to include in the file. This drop-down shows the different views available for this agent; if you don’t know which one to choose, select the All Items option.
Choose the file type you want to send to the FTP server. Your choices are .csv, .tsv, .xml, or .json.
Choose when you want the data to be published. You can publish the data (a) after every time the agent runs, (b) on an independent schedule, or (c) manually.
Enter the computer address of the FTP server. This will generally be an IP address or subdomain.
Click the wrench 🔧 next to the computer address for additional settings.
Enter the File location, Authentication, and Connection data.Specify a folder location only if you need the data sent to a specific folder on the remote server. A username and password are usually required for FTP connections.
Click Save. If the remote server has a firewall configured, make sure that the following IP range is whitelisted to allow publishing: 184.108.40.206 – 220.127.116.11, 18.104.22.168
More Information: FTP Publishing Settings
This setting tells the system the location of the ftp site. This can either be an IP address or a url. An example would be customerdata.mozenda.com. Make sure to include the full path or IP address when setting up.
This is where you can set the username and password, as well as change the transfer mode type.
This is the folder that the system needs to navigate to once the system has connected to the ftp site. Generally this will start with a forward slash “/”.
This is the username that the Mozenda system will use to successfully login and connect to the ftp site
This is the password for the corresponding username.
This is the port that the system will need to use to connect to the ftp site. The default for ftp servers is port 21.
Use passive transfer mode
Depending on the ftp server’s configuration this setting may need to be configured. Please contact the ftp server’s administrator for information on whether this should be enabled or not.
Use a secure connection
This allows customers to use the SFTP protocol when connecting to the ftp site. Contact the ftp server’s administrator to verify the site accepts SFTP connections.
Test FTP Settings
This button will test the current ftp publishing settings to ensure that the system can successfully connect and has the permissions to add new files. Note, this test will not necessarily come from one of the public IP Addresses listed below. Therefore, if custom Firewall exceptions have been configured then the only certain way to see if the ftp settings are correct is to click the Save & Publish Now button and see if the file is sent correctly.
Email Publishing Settings
Here the user can specify an email address for the file to be sent to in the form of an attachment. Separate multiple email addresses with a comma. Note, the file will not be sent if it is over 2 MB in size. For larger files the FTP Publishing option should be used.
Generic Publish Settings
What to include in the file
This setting allows the user to choose a view as the publishing view of the data. The default will be the default view.
Choose whether the published file should be in CSV, TSV, or XML format.
This allows the user to specify the name of the file that will be sent via ftp. If it is left blank then the name of the file will be set as the Collection name and the view name in this format:
If the file exists when the system publishes the file then the existing file will be overwritten.
|%DateTime%||This will insert a Date time value in the format of YYYY-MM-DD-HHMMSS.|
|%Date%||This will insert a Date value in the format of YYYY-MM-DD.|
|%YYYY%||This will insert the current year in the format of YYYY.|
|%MM%||This will insert the current month in the format MM.|
|%DD%||This will insert the current day of the month in the file name.|
|%CollectionName%||This will insert the name of the collection.|
|%CollectionID%||This will insert the ID of the collection.|
|%AgentID%||This will insert the ID of the agent (when applicable).|
|%ViewName%||This will insert the name of the view.|
|%ViewID%||This will insert the ID of the view.|
An example of a file name that would use the Datetime variable is CNN-%Date%. If this was published in CSV format and the date when the file was created was 2009-01-18 then the file’s name would be CNN-2009-01-18.CSV.
Include field names in the first row
This setting will place the field names of the data in the first line of the file.
When to publish the file
This setting provides two options. Either the file will be published every time the agent finishes, or the user can specify a certain schedule when the data will be published. Note, publishing schedules are completely independent from when an agent runs.