FTP log

One Star

FTP log

Hello,
I am new to TOS and what i try to achieve is to set up a dataflow getting files form one server and reproduce them to 6 other servers.
I am using the ftpget and ftpput funcitions and all works fine, however i would like to get a report whether the transfer has been succeeded or not (and the reason why not).
Kind of like the output from a dos ftp command.
Is there a funcion i can use for that?

Kind regards,
Tom Blank
One Star

Re: FTP log

use a tJava (if you're connecting via Trigger Link ) or tJavaRow (if you're connecting via Row Link )
press CTRL-SPACE in the code box, and you'll get a drop down of the available variables and functions and whatnot
-if you're using 2.4.1 (first pic), you'll be able to get the number of lines (NB_LINE) and error message (ERROR_MESSAGE)
--you could use code like this, in your tJava or tJavaRow, to print out output to your console (aka the Run tab):
System.out.println("***tFTPGet***");
System.out.println("Error Message = " + ((String)globalMap.get("tFTPGet_1_ERROR_MESSAGE")) );
System.out.println("Nb File = " + ((Integer)globalMap.get("tFTPGet_1_NB_FILE")) );
System.out.println("***tFTPPut***");
System.out.println("Error Message = " + ((String)globalMap.get("tFTPPut_1_ERROR_MESSAGE")) );
System.out.println("Nb File = " + ((Integer)globalMap.get("tFTPPut_1_NB_FILE")) );

-if you're using 3.0.0M3 or 3.0.0RC1 (second pic), you'll be able to get the current status (CURRENT_STATUS) for both components, and if the file exists (CURRENT_FILE_EXISTS) with tFTPPut
--you could use code like this, in your tJava or tJavaRow, to print out output to your console (aka the Run tab):
System.out.println("***tFTPGet***");
System.out.println("Current Status = " + ((String)globalMap.get("tFTPGet_1_CURRENT_STATUS")) );
System.out.println("Error Message = " + ((String)globalMap.get("tFTPGet_1_ERROR_MESSAGE")) );
System.out.println("Nb File = " + ((Integer)globalMap.get("tFTPGet_1_NB_FILE")) );
System.out.println("***tFTPPut***");
System.out.println("Current Status = " + ((String)globalMap.get("tFTPPut_1_CURRENT_STATUS")) );
System.out.println("Error Message = " + ((String)globalMap.get("tFTPPut_1_ERROR_MESSAGE")) );
System.out.println("Nb File = " + ((Integer)globalMap.get("tFTPPut_1_NB_FILE")) );
System.out.println("Current File Exists? = " + ((Boolean)globalMap.get("tFTPPut_1_CURRENT_FILE_EXISTS")) );

if you have any other information you would like, you can add a note to this feature request i've just made: 5213
One Star

Re: FTP log

Thank you for the reply.
I have implemented it as suggested and it works fine.
Now i will look for a way to pipe it to a file and mail it to me and i am done
Kind regards.
/Tom

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now