Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Redirecting the console output directly to email message body

Hi,
I have a requirement of redirecting console output to email. But, the console output needs to be written to the message body of the email. 
I also understand that tjava needs to be used. May I know where must I connect it?
I DO NOT want to write into any file and then read it or attach to an email.
 I want to run this as a .sh job
Please find the below screenshot. I have introduced an error on purpose in the tmysqloutput. 

0683p000009MFR8.png

I also want the job to stop executing and hence, used the tdie. 
Request you to help me achieve this
Thanks in advance

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi,
We usually use tLogCatcher to capture the error message and log them into file or database, but it is impossible to output the full stack trace.
We can capture the error message "[font=Verdana, Helvetica, Arial, sans-serif]Exception in component tmysqlsp_1[/font]
[font=Verdana, Helvetica, Arial, sans-serif]com.mysql.jdbc.exception.jdbc.mysqlsyntaxErrorException[/font]" with tLogCatcher component, not the full stack trace.
Did you really need to redirect the full stack trace on console output to email?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Sabrina,
Thank you for the response.
The error message as shown  by you is enough and the full stack trace would not be needed
Please find below the job design. Inside tjavarow I have globalMap.put("errorCode", input_row.message);
And inside the message body of tsendmail I have "the error message is: "+(String)globalMap.get("errorCode")
0683p000009MFQV.png

This works. I get the error in the body of the email. However, the job does not get killed  and keeps running and sends infinite number of emails. I have to manually kill the job to stop it. The tdie is not killing the job. 

Please let me know where am I going wrong.

Also, in case of Rejects I would want to send an warning email and do not want the job to end. How do I accomplish this?  The rejects go to a database table.

Regards
Rathi