Member since
02-18-2020
5
Posts
1
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2977 | 02-19-2020 12:04 AM |
02-19-2020
12:04 AM
1 Kudo
Ok so me and my mate figured it out :). Finally! its like this $.outputs[?(@.name=="EM_CLASSIFICATION")].value
... View more
02-18-2020
11:12 PM
Tried it still nothing assigning and tried all the below $.['EM_CLASSIFICATION'] $.{EM_CLASSIFICATION} $.{'EM_CLASSIFICATION'} $.'{outputs.EM_CLASSIFICATION}' $.outputs.{'EM_CLASSIFICATION'} $.outputs.{EM_CLASSIFICATION} $.outputs.{'name.EM_CLASSIFICATION'} $.outputs.['..EM_CLASSIFICATION'] $.outputs.{'name'..'EM_CLASSIFICATION'} might just plonk the full json in nvarchar field in sql and sql it out properly over their.
... View more
02-18-2020
02:17 PM
Thanks for your help @stevenmatison and @justenji . I have managed to get the below json attributes successfully with simple $.AtrributeName { "test" : "7", "dm0001al" : "-2", "pp0406ln" : "5", "pp0935cl" : "121", "eq0001fl" : "-1", "pp0406cl" : "1352", "pp0934cc" : "-2", "pp0026al" : "0", "pp0035al" : "8", "pp0901lb" : "-2", "id" : 4, "inputs" : [ { "name" : "test", "value" : 3 }, { "name" : "dm0001al", "value" : 1 }, { "name" : "pp0406ln", "value" : 1 }, { "name" : "pp0935cl", "value" : 1 }, { "name" : "eq0001fl", "value" : 1 }, { "name" : "pp0406cl", "value" : 1 }, { "name" : "pp0934cc", "value" : 1 }, { "name" : "pp0026al", "value" : 1 }, { "name" : "pp0035al", "value" : 1 }, { "name" : "pp0901lb", "value" : 1 } ] } But I am still struggling with the below one I tried a couple of tricks in EvalutuateIJson processor but still not values are assigning to attributes: The content of my incoming flow is in full JSon and looks like the below. This is the full json { "outputs" : [ { "name" : "EM_CLASSIFICATION", "value" : "1" }, { "name" : "EM_EVENTPROBABILITY", "value" : 0.9512272865085364 }, { "name" : "EM_PROBABILITY", "value" : 0.9512272865085364 }, { "name" : "I_Responded", "value" : "1" }, { "name" : "MSLR_woe", "value" : 4.4659 }, { "name" : "P_Responded0", "value" : 0.048772713491463615 }, { "name" : "P_Responded1", "value" : 0.9512272865085364 }, { "name" : "dm0001al_woe", "value" : 0.853 }, { "name" : "eq0001fl_woe", "value" : 0.9315 }, { "name" : "pp0026al_woe", "value" : -0.2929 }, { "name" : "pp0035al_woe", "value" : 0.5839 }, { "name" : "pp0406cl_woe", "value" : 0.6062 }, { "name" : "pp0406ln_woe", "value" : 1.3878 }, { "name" : "pp0901lb_woe", "value" : 0.1952 }, { "name" : "pp0934cc_woe", "value" : -1.3256 }, { "name" : "pp0935cl_woe", "value" : -0.5781 } ] } I tried $.outputs.pp0935cl_woe $.outputs..pp0935cl_woe $.['pp0935cl_woe'] $.outputs.name.pp0935cl_woe Still nothing coming through in the attributes. Any suggestions? Thanks
... View more
02-18-2020
08:42 AM
Please can you give me an example of how i would extract the "test" values from the below json
I tried the following but not winning ,
$.outputs.name.test1
$.test1
$.outputs.test1
I am using the processor "evaluate json path"
The below is a response from a webservice I am calling . I want the "test" values to be inserted in a sql table
"outputs": [ { "name": "test1", "value": "1" }, { "name": "test2", "value": 0.9512272865085364 }, { "name": "test3", "value": 0.9512272865085364 }, { "name": "test4", "value": "1" }, { "name": "test5", "value": 4.4659 }, { "name": "test6", "value": 0.048772713491463618 } ] }
... View more
Labels:
- Labels:
-
Apache NiFi