- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
ExecuteStreamCommand processor. set execute comand curl -X PUT to transfer json data. trouble with autodelete double qoutes by processor
- Labels:
-
Apache NiFi
Created on ‎10-16-2022 11:01 AM - edited ‎10-16-2022 11:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I want to transfer json using curl to ExecuteStreamCommand processor. Problem with deleting double quotes.
The ExecuteStreamCommand processor automatically removes double quotes when generating a string for an executable command.
there is an ExecuteStreamCommand processor
Command Path ---> curl
Command Arguments ---->
-X PUT dev.exemple.com/api/items/4126664 -vs -H 'Content-Type: application/json' --data '{"details":{"Produce":"Gigabyte","l(sm) ":0.0,"manufacturerCountry"}}'
This processor during the formation of the general command curl -X PUT dev...etc. automatically removes double quotes from the command text and sends the command without double quotes. ——->
curl -X PUT dev.exemple.com/api/items/4126664 -vs -H 'Content-Type: application/json' --data '{details:{
If you escape double quotes
Command Arguments ---->
-X PUT dev.exemple.com/api/items/4126664 -vs -H 'Content-Type: application/json' --data '{\"details\":{\"Produce\":\"Gigabyte\" ,\"l(sm)\":0.0,\"manufacturerCountry\"}}'
then nifi does not remove the double quotes, but passes the string to the command also with a screen before the double quotes. doesn't roll either.
I found advice to somehow create my own rule / strategy for passing arguments to the command, and there you need to specify that double quotes are not removed. but nowhere did I find an example or a hint. in the documentation of the processor itself, a general description, but there are no examples of creation.
Created ‎10-24-2022 09:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@dubrovski
Rather than using ExecuteStreamCommand processor to execute Curl, have you tried using the invokeHTTP processor instead for your PUT operation?
If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.
Thank you,
Matt
