Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

logging tAssertCatcher logs in seperate files in the same job

Highlighted
One Star
One Star

logging tAssertCatcher logs in seperate files in the same job

Hi,
I have a job in which I am making multiple webservice calls one after the other.
So my job is like,
tXMLRPCInput1->tLogRow1->OnComponentOK->tXMLRPCInput2->tLogRow2->OnComponentOK->tXMLRPCInput3->tLogRow3.
Now I want to insert tAssert component after each webservice call to check the sub status. So my job would be like,
tXMLRPCInput1->tAssert_1->Iterate->tXMLRPCInput2->tAssert_2->Iterate->tXMLRPCInput3->tAssert_3->tLogRow.
However I want the catched result from tAssertCatcher to be logged into 3 different log files i.e the
result of tAssert_1 should be logged in log1.txt;
result of tAssert_2 should be logged in log2.txt;
result of tAssert_3 should be logged in log3.txt;

Right now, when I execute using tAssertCatcher, all the results are being consolidated into a single file.
Kindly suggest how I may achieve the goal.
Thanks.
Highlighted
One Star
One Star

Re: logging tAssertCatcher logs in seperate files in the same job

Hi,
Also when a series of values are generated by the webservice response, the previous status should not be overwritten by the new status, it should be appended.
For eg, my tXMLRPCInput1 response returns Ok; Fail
So the Fail value should not replace the first Ok value.
My log status in log1.txt should be,
moment pid project job language origin status substatus description
xxx xxx xxx xx xxx xxx Ok xxx xxx
xxx xxx xxx xx xxx xxx Fail xxx xxx

Thanks
Highlighted
Community Manager

Re: logging tAssertCatcher logs in seperate files in the same job

Hi
Add a tMap after tAssertCatcher, define three output tables and add filter condition to filter the assertion that comes from different tAssert component, for example, add a filter expression for out1 as below:
row1.origin.equlas("tAssert_1")
out1 will be written into log1.txt.
....tMap--out1--tFileOutputDelimited_1 (log1.txt)
--out2--tFileOutputDelimited_2 (log2.txt)
--out3--tFileOutputDelimited_3 (log3.txt)
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
One Star
One Star

Re: logging tAssertCatcher logs in seperate files in the same job

Hi Shong,
Thanks a looot for that solution!! Works perfectly!!!
However I am still facing the issues with appending values to the file.
I re-directed my outputs to a spreadsheet using tFileOutputExcel and I enabled the checkbox which says "Append existing file", however my previous status still gets overridden. How can i avoid this?
Thanks
Highlighted
One Star
One Star

Re: logging tAssertCatcher logs in seperate files in the same job

Hi Shong,
Appending issue is also resolved. I had not checked "Append existing sheet". So all issues resolved now. Thanks a lot for you guidance.

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog