Member since
10-01-2019
2
Posts
0
Kudos Received
0
Solutions
10-01-2019
02:17 AM
Python Script Nifi Flow Logs written by Python Script Data Provenance view
... View more
10-01-2019
02:12 AM
Hi,
I am using two steps in Nifi:
1. The first step is InvokeHTTP processor to make a REST API call and receive a JSON response. I have used "Put Response Body In Attribute" to store the JSON response into an attribute.
2. The next step is ExecuteStreamCommand processor to invoke Python script and passing the JSON response attribute from previous step as an input argument. The Command Argument passed to the processor is:
/home/kavipriya/script/Scaling.py;"${AssetModel}";
I am able to read the JSON message within my python script, but the double quotes within original JSON message are removed by Nifi and I get following error when parsing the JSON message:
"json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 3 column 5 (char 10)"
Can someone tell me why are the double quotes removed when JSON message passed as argument and also if there is an option to retain the double quotes. Thanks for your help!
I have attached the screenshots and also the JSON message passed to python script and also the python logs showing double quotes missing when reading the argument.
... View more
Labels:
- Labels:
-
Apache NiFi