Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Pass output of ListenTCP as a command line argument into ExecuteStreamCommand

Pass output of ListenTCP as a command line argument into ExecuteStreamCommand

Expert Contributor

Hi, I am trying to pass output from a ListenTCP processor into a python code. I have tried passing it in as a command line argument using an ExecuteStreamCommand processor, but had no luck this way, because i had to assign the output an attribute name to pass it as an argument. Is there an alternative way? Thank you.

2 REPLIES 2
Highlighted

Re: Pass output of ListenTCP as a command line argument into ExecuteStreamCommand

Expert Contributor
@Roger Young

Parse an output of your processor and assign values to attribute/s. Then in python code your attribute will be available within a flowfile. If this doesn't work for you, please provide more details.

Highlighted

Re: Pass output of ListenTCP as a command line argument into ExecuteStreamCommand

Expert Contributor

Hi @Ed Berezitsky. I assign the output of ListenTCP an attribute called "request" and pass it into my python code via command line argument as shown here:

C:\Users\r.young\threshold-1.py;${request}

However, i get an error saying list index sys.argv[1] out of range.

I know the ${request} is correct because when i send it directly to a putTCP processor, i can view its content, the issue i am having is trying to pass it correctly into my code. Thank you

Don't have an account?
Coming from Hortonworks? Activate your account here