1

I am trying to get an hdfs location and provide it as email attachment to oozie email action. My hdfs location can be found only using a shell action. Now how can I pass the output of my shell action, which would be the hdfs path to my oozie email action. Can this be achieved using oozie?

<workflow-app name="[WF-DEF-NAME]" xmlns="uri:oozie:workflow:0.1">
  ...
  <action name="[NODE-NAME]">
    <email xmlns="uri:oozie:email-action:0.2">
        <to>[COMMA-SEPARATED-TO-ADDRESSES]</to>
        <subject>[SUBJECT]</subject>
        <body>[BODY]</body>
        <content_type>[CONTENT-TYPE]</content_type> 
        **<attachment>[COMMA-SEPARATED-HDFS-FILE-PATHS]</attachment>** 
    </email>
    <ok to="[NODE-NAME]"/>
    <error to="[NODE-NAME]"/>
  </action>
  ...
</workflow-app>
2
  • or can i send an hdfs file using bash's mail command, without copying it to local? Commented Jan 27, 2016 at 20:58
  • I recently answered a question has to do exactly the same. stackoverflow.com/questions/34943757/submit-pig-job-from-oozie/… Check my update on the answer where I attached a working example, how to capture a shell action output and pass it as a parameter of another action node.
    – kecso
    Commented Jan 29, 2016 at 4:30

1 Answer 1

3

See my comment, but for others checking this issue, the answer is: Capture the output of the shell action

<capture-output/>

and pass it as a param for the email action

<attachment>${wf:actionData('shell_action')['path']}</attachment>

For detail check the link in my comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.