This article explains how to send job results directly to your FTP server, with FTPS (explicit) or FTPES (implicit).
For sample workflows on how to export job results to your FTP server, view Treasure Boxes.
Basic knowledge of Treasure Data, including the TD toolbelt.
An FTP server
You can limit access to your endpoint by using a list of static IPs. Contact email@example.com if you need it.
Get your Credential for your FTP(S) Server
Obtain your credential to access your FTP(S) server.
Write the Query
Navigate to the TD Console query editor page and compile your query.
Specify the Result Export target
In the same window, select Add in the Result Export section and select FTP from the drop-down menu. Edit all the information, including your Host, Port, Username, Password.
If you want to connect to FTP Server with FTPS(explicit) or FTPES(implicit), select Use SSL? and select proper options.
Execute the Query
Either save the query with a name and run or just run the query. Upon successful completion of the query, its result will be automatically imported to the specified Container destination:
Usage from CLI
You can also use CLI for Result Export to FTP(S).
CLI for FTP
CLI for FTPS (Implicit mode)
CLI for FTPES (Explicit mode)
We kept this feature for backward compatibility and will stop providing it in the near future.
For On-Demand Jobs
For on-demand jobs, just add the --result option to the td query command. After the job is finished, the results are sent to the specified FTP server.
If a port number is not specified, the default value is 21.
The request body is in CSV format (RFC 4180) where the first line is a header with the column names, the new line is CRLF, the text encoding is UTF-8, and the quotation character is double-quoted.
For Scheduled Jobs
For scheduled jobs, just add the --result option when scheduling a job. After every job run, the results are sent in the same manner as on-demand jobs.