You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Buntu Dev <bu...@gmail.com> on 2018/05/08 20:14:45 UTC

Oozie email action truncating the string containing newline chars

I've this output captured from the shell action:

SHELL_OUTPUT='John,28,1,0
Jack,32,0,15
Mary,45,23,12
Jill,33,12,55'

The email action uses this captured output in the body like this:

Data: ${ wf:actionData('shell-c23f')['SHELL_OUTPUT'] }

But the email received seems to be truncated and only sending the first
line instead of the complete string, for example:

Data: John,28,1,0

How do I go about making sure the complete string is part of the body of
the email?

Thanks!

Re: Oozie email action truncating the string containing newline chars

Posted by Buntu Dev <bu...@gmail.com>.
Thanks a lot for the pointer, this worked for me:

SHELL_OUTPUT='John,28,1,0\n\
Jack,32,0,15\n\
Mary,45,23,12\n\
Jill,33,12,55'



On Tue, May 8, 2018 at 2:11 PM, Peter Cseh <ge...@cloudera.com> wrote:

> Hey!
> The action output is treated and parsed as a serialized
> java.util.Properties object.
> You can test out what works for you easily by using  a Properties object
> and fool around with it.
>
> E.g. something like
> SHELL_OUTPUT='John,28,1,0 \
> Jack,32,0,15 \
> Mary,45,23,12 \
> Jill,33,12,55'
>
> should work fine.
>
> gp
>
> On Tue, May 8, 2018 at 10:14 PM, Buntu Dev <bu...@gmail.com> wrote:
>
> > I've this output captured from the shell action:
> >
> > SHELL_OUTPUT='John,28,1,0
> > Jack,32,0,15
> > Mary,45,23,12
> > Jill,33,12,55'
> >
> > The email action uses this captured output in the body like this:
> >
> > Data: ${ wf:actionData('shell-c23f')['SHELL_OUTPUT'] }
> >
> > But the email received seems to be truncated and only sending the first
> > line instead of the complete string, for example:
> >
> > Data: John,28,1,0
> >
> > How do I go about making sure the complete string is part of the body of
> > the email?
> >
> > Thanks!
> >
>
>
>
> --
> *Peter Cseh *| Software Engineer
> cloudera.com <https://www.cloudera.com>
>
> [image: Cloudera] <https://www.cloudera.com/>
>
> [image: Cloudera on Twitter] <https://twitter.com/cloudera> [image:
> Cloudera on Facebook] <https://www.facebook.com/cloudera> [image: Cloudera
> on LinkedIn] <https://www.linkedin.com/company/cloudera>
> ------------------------------
>

Re: Oozie email action truncating the string containing newline chars

Posted by Peter Cseh <ge...@cloudera.com>.
Hey!
The action output is treated and parsed as a serialized
java.util.Properties object.
You can test out what works for you easily by using  a Properties object
and fool around with it.

E.g. something like
SHELL_OUTPUT='John,28,1,0 \
Jack,32,0,15 \
Mary,45,23,12 \
Jill,33,12,55'

should work fine.

gp

On Tue, May 8, 2018 at 10:14 PM, Buntu Dev <bu...@gmail.com> wrote:

> I've this output captured from the shell action:
>
> SHELL_OUTPUT='John,28,1,0
> Jack,32,0,15
> Mary,45,23,12
> Jill,33,12,55'
>
> The email action uses this captured output in the body like this:
>
> Data: ${ wf:actionData('shell-c23f')['SHELL_OUTPUT'] }
>
> But the email received seems to be truncated and only sending the first
> line instead of the complete string, for example:
>
> Data: John,28,1,0
>
> How do I go about making sure the complete string is part of the body of
> the email?
>
> Thanks!
>



-- 
*Peter Cseh *| Software Engineer
cloudera.com <https://www.cloudera.com>

[image: Cloudera] <https://www.cloudera.com/>

[image: Cloudera on Twitter] <https://twitter.com/cloudera> [image:
Cloudera on Facebook] <https://www.facebook.com/cloudera> [image: Cloudera
on LinkedIn] <https://www.linkedin.com/company/cloudera>
------------------------------