apache-nifi

NiFi How to use InvokeHTTP Processor with SOAP

◇◆丶佛笑我妖孽 提交于 2019-12-23 04:31:48
问题 I see that others have been able to get this to work however I am unable to find enough detail explaining how they accomplished this in order for me to get this to work. This guy at this link claims he was able to do this. While there is a brief description as to how to do this I don't fully understand it. The solution presented was: With InvokeHTTP, you can add dynamic properties, which will be sent in the request as headers. You can use dynamic properties to set values for the Content-Type

NiFi How to use InvokeHTTP Processor with SOAP

做~自己de王妃 提交于 2019-12-23 04:31:13
问题 I see that others have been able to get this to work however I am unable to find enough detail explaining how they accomplished this in order for me to get this to work. This guy at this link claims he was able to do this. While there is a brief description as to how to do this I don't fully understand it. The solution presented was: With InvokeHTTP, you can add dynamic properties, which will be sent in the request as headers. You can use dynamic properties to set values for the Content-Type

Sorting a json array in a single flowfile based on a Json attribute : Apache Nifi

ぃ、小莉子 提交于 2019-12-23 02:02:03
问题 I have been trying nifi and wanted to know how to sort an array of json by an attribute. I have Json like this [{“name”:”Backham”,”createdDate”:”2018-05-07 06:30:09”},{“name”:”Rooney”,”createdDate”:”2016-05-12 19:50:03”},{“name”:”Ronaldo”,”createdDate”:”2019-01-07 06:30:09”}] I have to sort by createdDate asc/desc. I know that I can write a custom processor to sort the data and send it back. Is there any other better way of doing this? Can anyone please tell me how to accomplish this? 回答1:

NiFi convert json to csv using ConvertRecord

落爺英雄遲暮 提交于 2019-12-23 01:48:45
问题 i have a stream of json in apache nifi that contain dynamic fields (maximum 11 fields) and i want to convert it to csv file. sample json: { "field1":"some text", "field2":"some text", "field3":"some text", "field4":"some text", "field5":"some text", "field6":"some text", "field7":"some text" } i don't wanna using replace or json evaluate; how i do it with ConvertRecord? using this processor is so odd and hard to work... Clear expression about dynamic fields: i have 11 fields at total. one

Delete empty attributes in NiFi

ぐ巨炮叔叔 提交于 2019-12-23 01:13:40
问题 Because of this issue being still unresolved, I have an EvaluateJsonPath processor that sometimes outputs attributes with empty strings. Is there a straight-forward way to delete attributes from a flowfile? I tried using the UpdateAttributes processor, but it only is able to delete based on matching an attribute's name (I need to match on the attribute's value). 回答1: you can use ExecuteGroovyScript 1.5.0 processor with the following code: def ff=session.get() if(!ff)return def emptyKeys = ff

How to get ISO string in Nifi getMongo Query Field

跟風遠走 提交于 2019-12-22 17:37:27
问题 I'm trying to use expression languge to generate ISO string in Nifi getMongo Query field using following query, { "remindmeDate": { "$gte": "${now():format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",'GMT')}", "$lte": "${now():toNumber():plus(359999):format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",'GMT')}" } } But i'm getting invalid JSON error error as double quotes are not escaped. When we try to escape it using \ operator, nifi is not evaluating the expression language. Is there any method or workaround to get

In NiFi processor 'InvokeHTTP' where do you write body of POST request?

こ雲淡風輕ζ 提交于 2019-12-22 09:37:48
问题 Before posting this question about Apache NiFi InvokeHTTP I have gone through all other questions and their answersbut I am still unsure the best flow I should have. My situation is as below: 1) From Apache Kakfa, I get raw metadata. 2) Using EvaluateJSONPath I get attribute I want. 3) Using RouteOnAttribute I created 3 routes based on the attribute value I got from step-2 above. 4) Now based on the attribute value I want to decide whether I should go for GET or for POST or for Delete. 5) My

Post a NIFI template via REST?

一世执手 提交于 2019-12-22 05:48:08
问题 I have multiple nifi servers that I would like to be able to POST templates to via the REST interface from a script The "/controller/templates" endpoint appears to be the proper REST endpoint to support POSTing an arbitrary template to my Nifi installation. The "snippetId" field is what is confusing me, how do I determine "The id of the snippet whose contents will comprise the template"? Does anyone have an example of how I can upload a template "test.xml" to my server without having to use

I have two Json payload. I want to merge them in a single Json object

青春壹個敷衍的年華 提交于 2019-12-20 05:28:14
问题 I have two payloads and want to merge them into single JSON object (streaming join). At few places people are suggesting to use AttributesToJSON, but as one of the JSON does not have fix set of attributes I guess that would not be possible. First payload is { "title":"API-Actions Documentation", "title_link":"https://api.slack.com/", "author_name":"name", "author_link":"http://flickr.com/bobby/", "author_icon":"http://flickr.com/icons/bobby.jpg", "text":"Optional", "image_url":"http://my

Replace string value to integer value in NiFi within a same column

混江龙づ霸主 提交于 2019-12-20 03:22:29
问题 I want to replace a 'string value ' and enter that value as an Integer Value using Nifi ReplaceText. I do not know how to achieve this in NiFi. So my scenario is as follows: I will be having a CSV file with few fields with integers and few fields as total String values. For the fields that have a String value, I want to insert that as a pre-defined integer number into my database table. For Example: My CSV looks like the following: Field1, Field2, Field3, Field4,Field5 1,2, abc ,45, John 23