Member since
10-05-2022
8
Posts
0
Kudos Received
0
Solutions
01-11-2023
07:58 AM
Hello, I cannot find an answer on the www to my following question. I have tried splitjson and jolttransform to achieve my desired outcome, but nothing does the trick. My input file looks like this: { "BVjsoBHDSI" : { "date" : "2021-04-08", "description" : "blabla1", "number" : 40 }, "FudNSk" : { "date" : "2021-09-26", "description" : "blabla2", "number" : 80 }, "Cfjdsl54fd" : { "date" : "2022-05-10", "description" : "blablubb", "number" : 31 } } Actually I just want to split the stupid thing, but since the root level has a different individual value nifi doesn't understand what I want to do. The idea was to use a jolt transform to add a key "id" with the original key as value. I can't figure out a proper specification though. Glad to hear your ideas. Desired output: { "BVjsoBHDSI" : { "date" : "2021-04-08", "description" : "blabla1", "number" : 40, "id" : "BVjsoBHDSI" }, "FudNSk" : { "date" : "2021-09-26", "description" : "blabla2", "number" : 80, "id" : "FudNSk" }, "Cfjdsl54fd" : { "date" : "2022-05-10", "description" : "blablubb", "number" : 31, "id" : "Cfjdsl54fd" } } Then I could easily overwrite the root and split the flowfile as usual.
... View more
Labels:
- Labels:
-
Apache NiFi
12-01-2022
02:33 AM
Hi, thanks for the details. Unfortunately it is not working. I get an empty array [] as output. I have tried it with extract and split mode. I applied the schema text property as suggested with "NestedKey" and "nestedValue" as name. None gives me an output. Meanwhile I have achieved what I wanted using SplitContent and then again another jolt processor. Of course it would be more elegant if I could make it work with ForkRecord.
... View more
11-30-2022
01:36 AM
Hi, thanks for your suggestions. I don't know a lot about nifi, so it took me long enough to figure out how to find the correct jolt transformation to obtain the structure above. Unfortunately I also don't know how to configure the record writer properly. I can't find a good manual or examples on the web. Which strategy do I choose? What field can I give my wanted schema to?
... View more
11-25-2022
02:41 AM
Hello, unfortunately I couldn't find an answer for this question, although it seems to be easy enough. I have a json file of this format, which I want to generate separate flowfiles from singularizing the values in NestedKey2: My input: { "Key1" : [ { "NestedKey1" : "Value1", "NestedKey2" : [ "Value2", "Value3", "Value4", "Value5"], "NestedKey3" : "Value6" } ] } Desired output: Flowfile 1: { "Key1" : [ { "NestedKey1" : "Value1", "NestedKey2" : "Value2", "NestedKey3" : "Value6" } ] } Flowfile 2: { "Key1" : [ { "NestedKey1" : "Value1", "NestedKey2" : "Value3", "NestedKey3" : "Value6" } ] } ... and so on. Thanks for any suggestions.
... View more
Labels:
- Labels:
-
Apache NiFi
10-06-2022
07:56 AM
Thanks for your reply!! I would need something like if url_value:contains("webpage1") set api_value to "wepage1" elseif url_value:contains("webpage2") set api_value to "webpage2" and so on and so forth I don't see how I can do that using JOLT
... View more
10-06-2022
07:53 AM
Thanks for your replies!! I forgot to mention, the first value contains the value needed for my url_value. That's why I need rules as you can set in the UpdateAttribute. I have something like "www.webpage.com/sites " and need to extract "webpage" for my api_value. I don't see how I can do this with ReplaceText or with JOLT. I would need something like if url_value:contains("webpage1") set api_value to "webpage1" elseif url_value:contains("webpage2") set api_value to "webpage2" and so on and so forth
... View more
10-06-2022
06:52 AM
Hello there, I have flowfiles with json content, which I transform before using them to send a post request with InvokeHTTP. I have an attribute "url_value" which I can use to determine my "api_value". For now I use EvaluateJsonPath to add those values to the flowfile attributes, then I use UpdateAttribute where I have set some rules to get the correct api_value. Now my question: how do I get the value back into my content? If I use AttributesToJSON, it overrides all previous content, therefore I need to have extracted all necessary attributes with EvaluateJsonPath before. This is not a very elegant solution since there can be many entries and I actually only need to update one of them! Is there no processor similar to UpdateAttribute but for flowfile content? How could I use JoltTransformJSON to change a value depending on another attribute? Edit: I would need something like if url_value:contains("webpage1") set api_value to "wepage1" elseif url_value:contains("webpage2") set api_value to "webpage2" and so on and so forth I appreciate any hints. Thanks
... View more
- Tags:
- attributes
- json
- NiFi
Labels:
- Labels:
-
Apache NiFi
10-05-2022
08:15 AM
Hi, for me this is not working. My desired attribute remains unchanged after it undergoes the UpdateAttribute processor. What could be the cause of this? I have a property called "api" with the default value "web page". My rule is ${url:contains('webpage')} and the action "api" and "web page". The "url" property contains the address as in "https://www.webpage.com/site". Any ideas what I should check?
... View more
- Tags:
- updateattribute