Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How do I send a mail in Oozie by mentioning the Start Time and End Time in the mail body ?

avatar
Contributor

I need to capture the job status, Start time and End Time of the work and mail it using the mail action in Oozie.

1 ACCEPTED SOLUTION

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
7 REPLIES 7

avatar
Contributor

avatar
Master Guru

You can do this by setting a parameter with start and end time.

For example

<property>
<name>the_timestamp</name>
<value>${timestamp()}</value>
<property>

Set that to start time and another to end time when you hit a action.

For information on oozie emails here:

https://oozie.apache.org/docs/3.3.0/DG_EmailActionExtension.html

avatar
Contributor

Thanks, but I am not looking for timestamp, I need the job status and execution time. In short, I need to mail the output of this command, oozie job -oozie {SERVER_DETAILS} -info ${job_id}

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Contributor

@Kuldeep Kulkarni Is there a way where I can execute this command inside the mail action in oozie ?

oozie job -oozie {SERVER_DETAILS} -info ${job_id}

avatar
Master Guru

@Sai ram - No you cann't. But you can write a shell action and in shell script you can execute this command as well as mail command

avatar
Contributor

I need to capture the highlighted fields in the screenshot.

6056-capture.png