Support Questions
Find answers, ask questions, and share your expertise

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

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.

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