Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.
Labels (3)
4 Replies
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
0683p000009ME5i.png
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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.